# # # patch "lib/Monotone/AutomateStdio.pm" # from [0f15b66358cb84ad4b56d575591e479a45c1fc66] # to [2403487abd1909b362770c74170b7d5ce0a7a335] # ============================================================ --- lib/Monotone/AutomateStdio.pm 0f15b66358cb84ad4b56d575591e479a45c1fc66 +++ lib/Monotone/AutomateStdio.pm 2403487abd1909b362770c74170b7d5ce0a7a335 @@ -399,7 +399,7 @@ sub new_from_db($;$$) # Startup the mtn subprocess (also determining the interface version). - startup($this); + $this->startup(); return $this; @@ -458,7 +458,7 @@ sub new_from_ws($;$$) # Startup the mtn subprocess (also determining the interface version). - startup($this); + $this->startup(); return $this; @@ -497,7 +497,7 @@ sub DESTROY local $@; eval { - closedown($this); + $this->closedown(); }; } @@ -526,7 +526,7 @@ sub ancestors($$@) my($this, $list, @revision_ids) = @_; - return mtn_command($this, "ancestors", $list, @revision_ids); + return $this->mtn_command("ancestors", $list, @revision_ids); } # @@ -556,11 +556,10 @@ sub ancestry_difference($$$;@) my($this, $list, $new_revision_id, @old_revision_ids) = @_; - return mtn_command($this, - "ancestry_difference", - $list, - $new_revision_id, - @old_revision_ids); + return $this->mtn_command("ancestry_difference", + $list, + $new_revision_id, + @old_revision_ids); } # @@ -584,7 +583,7 @@ sub branches($$) my($this, $list) = @_; - return mtn_command($this, "branches", $list); + return $this->mtn_command("branches", $list); } # @@ -612,7 +611,7 @@ sub cert($$$$) my $dummy; - return mtn_command($this, "cert", \$dummy, $revision_id, $name, $value); + return $this->mtn_command("cert", \$dummy, $revision_id, $name, $value); } # @@ -643,7 +642,7 @@ sub certs($$$) if (ref($ref) eq "SCALAR") { - return mtn_command($this, "certs", $ref, $revision_id); + return $this->mtn_command("certs", $ref, $revision_id); } else { @@ -651,7 +650,7 @@ sub certs($$$) my($i, @lines); - if (! mtn_command($this, "certs", address@hidden, $revision_id)) + if (! $this->mtn_command("certs", address@hidden, $revision_id)) { return; } @@ -709,7 +708,7 @@ sub children($$$) my($this, $list, @revision_ids) = @_; - return mtn_command($this, "children", $list, @revision_ids); + return $this->mtn_command("children", $list, @revision_ids); } # @@ -737,7 +736,7 @@ sub common_ancestors($$@) my($this, $list, @revision_ids) = @_; - return mtn_command($this, "common_ancestors", $list, @revision_ids); + return $this->mtn_command("common_ancestors", $list, @revision_ids); } # @@ -791,11 +790,10 @@ sub content_diff($$;$$$@) push(@opts, {key => "r", value => $revision_id2}) unless (! defined($revision_id2)); - return mtn_command_with_options($this, - "content_diff", - $buffer, - address@hidden, - @file_names); + return $this->mtn_command_with_options("content_diff", + $buffer, + address@hidden, + @file_names); } # @@ -821,7 +819,7 @@ sub db_get($$$$) my($this, $buffer, $domain, $name) = @_; - return mtn_command($this, "db_get", $buffer, $domain, $name); + return $this->mtn_command("db_get", $buffer, $domain, $name); } # @@ -848,7 +846,7 @@ sub descendents($$@) my($this, $list, @revision_ids) = @_; - return mtn_command($this, "descendents", $list, @revision_ids); + return $this->mtn_command("descendents", $list, @revision_ids); } # @@ -877,7 +875,7 @@ sub drop_attribute($$$) my $dummy; - return mtn_command($this, "drop_attribute", \$dummy, $path, $key); + return $this->mtn_command("drop_attribute", \$dummy, $path, $key); } # @@ -906,7 +904,7 @@ sub drop_db_variables($$;$) my $dummy; - return mtn_command($this, "drop_db_variables", \$dummy, $domain, $name); + return $this->mtn_command("drop_db_variables", \$dummy, $domain, $name); } # @@ -934,7 +932,7 @@ sub erase_ancestors($$;@) my($this, $list, @revision_ids) = @_; - return mtn_command($this, "erase_ancestors", $list, @revision_ids); + return $this->mtn_command("erase_ancestors", $list, @revision_ids); } # @@ -971,13 +969,12 @@ sub file_merge($$$$$$) $right_revision_id, $right_file_name) = @_; - return mtn_command($this, - "file_merge", - $buffer, - $left_revision_id, - $left_file_name, - $right_revision_id, - $right_file_name); + return $this->mtn_command("file_merge", + $buffer, + $left_revision_id, + $left_file_name, + $right_revision_id, + $right_file_name); } # @@ -1008,7 +1005,7 @@ sub genkey($$$$) if (ref($ref) eq "SCALAR") { - return mtn_command($this, "genkey", $ref, $key_id, $pass_phrase); + return $this->mtn_command("genkey", $ref, $key_id, $pass_phrase); } else { @@ -1017,7 +1014,7 @@ sub genkey($$$$) $kv_record, @lines); - if (! mtn_command($this, "genkey", address@hidden, $key_id, $pass_phrase)) + if (! $this->mtn_command("genkey", address@hidden, $key_id, $pass_phrase)) { return; } @@ -1069,7 +1066,7 @@ sub get_attributes($$$) # This command was renamed in version 0.36 (i/f version 5.x). - if (supports($this, MTN_GET_ATTRIBUTES)) + if ($this->supports(MTN_GET_ATTRIBUTES)) { $cmd = "get_attributes"; } @@ -1083,7 +1080,7 @@ sub get_attributes($$$) if (ref($ref) eq "SCALAR") { - return mtn_command($this, $cmd, $ref, $file_name); + return $this->mtn_command($cmd, $ref, $file_name); } else { @@ -1091,7 +1088,7 @@ sub get_attributes($$$) my($i, @lines); - if (! mtn_command($this, $cmd, address@hidden, $file_name)) + if (! $this->mtn_command($cmd, address@hidden, $file_name)) { return; } @@ -1155,7 +1152,7 @@ sub get_base_revision_id($$) my @list; $$buffer = ""; - if (! mtn_command($this, "get_base_revision_id", address@hidden)) + if (! $this->mtn_command("get_base_revision_id", address@hidden)) { return; } @@ -1195,10 +1192,10 @@ sub get_content_changed($$$$) # Run the command and get the data. - if (! mtn_command($this, "get_content_changed", - address@hidden, - $revision_id, - $file_name)) + if (! $this->mtn_command("get_content_changed", + address@hidden, + $revision_id, + $file_name)) { return; } @@ -1250,11 +1247,11 @@ sub get_corresponding_path($$$$$) # Run the command and get the data. - if (! mtn_command($this, "get_corresponding_path", - address@hidden, - $source_revision_id, - $file_name, - $target_revision_id)) + if (! $this->mtn_command("get_corresponding_path", + address@hidden, + $source_revision_id, + $file_name, + $target_revision_id)) { return; } @@ -1326,22 +1323,20 @@ sub get_current_revision($$;$@) if (ref($ref) eq "SCALAR") { - return mtn_command_with_options($this, - "get_current_revision", - $ref, - address@hidden, - @paths); + return $this->mtn_command_with_options("get_current_revision", + $ref, + address@hidden, + @paths); } else { my @lines; - if (! mtn_command_with_options($this, - "get_current_revision", - address@hidden, - address@hidden, - @paths)) + if (! $this->mtn_command_with_options("get_current_revision", + address@hidden, + address@hidden, + @paths)) { return; } @@ -1377,7 +1372,7 @@ sub get_current_revision_id($$) my @list; $$buffer = ""; - if (! mtn_command($this, "get_current_revision_id", address@hidden)) + if (! $this->mtn_command("get_current_revision_id", address@hidden)) { return; } @@ -1415,7 +1410,7 @@ sub get_db_variables($$;$) if (ref($ref) eq "SCALAR") { - return mtn_command($this, "get_db_variables", $ref, $domain); + return $this->mtn_command("get_db_variables", $ref, $domain); } else { @@ -1426,7 +1421,7 @@ sub get_db_variables($$;$) $name, $value); - if (! mtn_command($this, "get_db_variables", address@hidden, $domain)) + if (! $this->mtn_command("get_db_variables", address@hidden, $domain)) { return; } @@ -1487,7 +1482,7 @@ sub get_file($$$) my($this, $buffer, $file_id) = @_; - return mtn_command($this, "get_file", $buffer, $file_id); + return $this->mtn_command("get_file", $buffer, $file_id); } # @@ -1521,11 +1516,10 @@ sub get_file_of($$$;$) push(@opts, {key => "r", value => $revision_id}) unless (! defined($revision_id)); - return mtn_command_with_options($this, - "get_file_of", - $buffer, - address@hidden, - $file_name); + return $this->mtn_command_with_options("get_file_of", + $buffer, + address@hidden, + $file_name); } # @@ -1556,7 +1550,7 @@ sub get_manifest_of($$;$) if (ref($ref) eq "SCALAR") { - return mtn_command($this, "get_manifest_of", $ref, $revision_id); + return $this->mtn_command("get_manifest_of", $ref, $revision_id); } else { @@ -1570,7 +1564,7 @@ sub get_manifest_of($$;$) $type, $value); - if (! mtn_command($this, "get_manifest_of", address@hidden, $revision_id)) + if (! $this->mtn_command("get_manifest_of", address@hidden, $revision_id)) { return; } @@ -1656,7 +1650,7 @@ sub get_option($$$) my($this, $buffer, $option_name) = @_; - if (! mtn_command($this, "get_option", $buffer, $option_name)) + if (! $this->mtn_command("get_option", $buffer, $option_name)) { return; } @@ -1694,14 +1688,14 @@ sub get_revision($$$) if (ref($ref) eq "SCALAR") { - return mtn_command($this, "get_revision", $ref, $revision_id); + return $this->mtn_command("get_revision", $ref, $revision_id); } else { my @lines; - if (! mtn_command($this, "get_revision", address@hidden, $revision_id)) + if (! $this->mtn_command("get_revision", address@hidden, $revision_id)) { return; } @@ -1734,7 +1728,7 @@ sub get_workspace_root($$) my($this, $buffer) = @_; - if (! mtn_command($this, "get_workspace_root", $buffer)) + if (! $this->mtn_command("get_workspace_root", $buffer)) { return; } @@ -1769,7 +1763,7 @@ sub graph($$) if (ref($ref) eq "SCALAR") { - return mtn_command($this, "graph", $ref); + return $this->mtn_command("graph", $ref); } else { @@ -1778,7 +1772,7 @@ sub graph($$) @lines, @parent_ids); - if (! mtn_command($this, "graph", address@hidden)) + if (! $this->mtn_command("graph", address@hidden)) { return; } @@ -1819,7 +1813,7 @@ sub heads($$;$) my($this, $list, $branch_name) = @_; - return mtn_command($this, "heads", $list, $branch_name); + return $this->mtn_command("heads", $list, $branch_name); } # @@ -1848,7 +1842,7 @@ sub identify($$$) my @list; $$buffer = ""; - if (! mtn_command($this, "identify", address@hidden, $file_name)) + if (! $this->mtn_command("identify", address@hidden, $file_name)) { return; } @@ -1881,7 +1875,7 @@ sub interface_version($$) my @list; $$buffer = ""; - if (! mtn_command($this, "interface_version", address@hidden)) + if (! $this->mtn_command("interface_version", address@hidden)) { return; } @@ -1942,22 +1936,20 @@ sub inventory($$;$@) if (ref($ref) eq "SCALAR") { - return mtn_command_with_options($this, - "inventory", - $ref, - address@hidden, - @paths); + return $this->mtn_command_with_options("inventory", + $ref, + address@hidden, + @paths); } else { my @lines; - if (! mtn_command_with_options($this, - "inventory", - address@hidden, - address@hidden, - @paths)) + if (! $this->mtn_command_with_options("inventory", + address@hidden, + address@hidden, + @paths)) { return; } @@ -1965,7 +1957,7 @@ sub inventory($$;$@) # The output format of this command was switched over to a basic_io # stanza in 0.37 (i/f version 6.x). - if (supports($this, MTN_INVENTORY_IN_IO_STANZA_FORMAT)) + if ($this->supports(MTN_INVENTORY_IN_IO_STANZA_FORMAT)) { my $i; @@ -2045,7 +2037,7 @@ sub keys($$) if (ref($ref) eq "SCALAR") { - return mtn_command($this, "keys", $ref); + return $this->mtn_command("keys", $ref); } else { @@ -2053,7 +2045,7 @@ sub keys($$) my($i, @lines); - if (! mtn_command($this, "keys", address@hidden)) + if (! $this->mtn_command("keys", address@hidden)) { return; } @@ -2117,7 +2109,7 @@ sub leaves($$) my($this, $list) = @_; - return mtn_command($this, "leaves", $list); + return $this->mtn_command("leaves", $list); } # @@ -2147,7 +2139,7 @@ sub lua($$$;@) my($this, $buffer, $lua_function, @arguments) = @_; - return mtn_command($this, "lua", $buffer, $lua_function, @arguments); + return $this->mtn_command("lua", $buffer, $lua_function, @arguments); } # @@ -2174,7 +2166,7 @@ sub packet_for_fdata($$$) my($this, $buffer, $file_id) = @_; - return mtn_command($this, "packet_for_fdata", $buffer, $file_id); + return $this->mtn_command("packet_for_fdata", $buffer, $file_id); } # @@ -2204,8 +2196,10 @@ sub packet_for_fdelta($$$$) my($this, $buffer, $from_file_id, $to_file_id) = @_; - return mtn_command - ($this, "packet_for_fdelta", $buffer, $from_file_id, $to_file_id); + return $this->mtn_command("packet_for_fdelta", + $buffer, + $from_file_id, + $to_file_id); } # @@ -2232,7 +2226,7 @@ sub packet_for_rdata($$$) my($this, $buffer, $revision_id) = @_; - return mtn_command($this, "packet_for_rdata", $buffer, $revision_id); + return $this->mtn_command("packet_for_rdata", $buffer, $revision_id); } # @@ -2259,7 +2253,7 @@ sub packets_for_certs($$$) my($this, $buffer, $revision_id) = @_; - return mtn_command($this, "packets_for_certs", $buffer, $revision_id); + return $this->mtn_command("packets_for_certs", $buffer, $revision_id); } # @@ -2285,7 +2279,7 @@ sub parents($$$) my($this, $list, $revision_id) = @_; - return mtn_command($this, "parents", $list, $revision_id); + return $this->mtn_command("parents", $list, $revision_id); } # @@ -2320,18 +2314,17 @@ sub put_file($$$$) if (defined($base_file_id)) { - if (! mtn_command($this, - "put_file", - address@hidden, - $base_file_id, - $contents)) + if (! $this->mtn_command("put_file", + address@hidden, + $base_file_id, + $contents)) { return; } } else { - if (! mtn_command($this, "put_file", address@hidden, $contents)) + if (! $this->mtn_command("put_file", address@hidden, $contents)) { return; } @@ -2366,7 +2359,7 @@ sub put_revision($$$) my @list; - if (! mtn_command($this, "put_revision", address@hidden, $contents)) + if (! $this->mtn_command("put_revision", address@hidden, $contents)) { return; } @@ -2398,7 +2391,7 @@ sub read_packets($$) my $dummy; - return mtn_command($this, "read_packets", \$dummy, $packet_data); + return $this->mtn_command("read_packets", \$dummy, $packet_data); } # @@ -2423,7 +2416,7 @@ sub roots($$) my($this, $list) = @_; - return mtn_command($this, "roots", $list); + return $this->mtn_command("roots", $list); } # @@ -2449,7 +2442,7 @@ sub select($$$) my($this, $list, $selector) = @_; - return mtn_command($this, "select", $list, $selector); + return $this->mtn_command("select", $list, $selector); } # @@ -2478,7 +2471,7 @@ sub set_attribute($$$$) my $dummy; - return mtn_command($this, "set_attribute", \$dummy, $path, $key, $value); + return $this->mtn_command("set_attribute", \$dummy, $path, $key, $value); } # @@ -2508,7 +2501,7 @@ sub set_db_variable($$$$) # This command was renamed in version 0.39 (i/f version 7.x). - if (supports($this, MTN_SET_DB_VARIABLE)) + if ($this->supports(MTN_SET_DB_VARIABLE)) { $cmd = "set_db_variable"; } @@ -2516,7 +2509,7 @@ sub set_db_variable($$$$) { $cmd = "db_set"; } - return mtn_command($this, $cmd, \$dummy, $domain, $name, $value); + return $this->mtn_command($cmd, \$dummy, $domain, $name, $value); } # @@ -2584,12 +2577,11 @@ sub show_conflicts($$;$$$) if (ref($ref) eq "SCALAR") { - return mtn_command_with_options($this, - "show_conflicts", - $ref, - address@hidden, - $left_revision_id, - $right_revision_id); + return $this->mtn_command_with_options("show_conflicts", + $ref, + address@hidden, + $left_revision_id, + $right_revision_id); } else { @@ -2597,12 +2589,11 @@ sub show_conflicts($$;$$$) my($i, @lines); - if (! mtn_command_with_options($this, - "show_conflicts", - address@hidden, - address@hidden, - $left_revision_id, - $right_revision_id)) + if (! $this->mtn_command_with_options("show_conflicts", + address@hidden, + address@hidden, + $left_revision_id, + $right_revision_id)) { return; } @@ -2675,7 +2666,7 @@ sub tags($$;$) if (ref($ref) eq "SCALAR") { - return mtn_command($this, "tags", $ref, $branch_pattern); + return $this->mtn_command("tags", $ref, $branch_pattern); } else { @@ -2683,7 +2674,7 @@ sub tags($$;$) my($i, @lines); - if (! mtn_command($this, "tags", address@hidden, $branch_pattern)) + if (! $this->mtn_command("tags", address@hidden, $branch_pattern)) { return; } @@ -2751,7 +2742,7 @@ sub toposort($$@) my($this, $list, @revision_ids) = @_; - return mtn_command($this, "toposort", $list, @revision_ids); + return $this->mtn_command("toposort", $list, @revision_ids); } # @@ -3081,11 +3072,11 @@ sub ignore_suspend_certs($$) if ($this->{honour_suspend_certs} && $ignore) { - if (supports($this, MTN_IGNORING_OF_SUSPEND_CERTS)) + if ($this->supports(MTN_IGNORING_OF_SUSPEND_CERTS)) { $this->{honour_suspend_certs} = undef; - closedown($this); - startup($this); + $this->closedown(); + $this->startup(); } else { @@ -3098,8 +3089,8 @@ sub ignore_suspend_certs($$) elsif (! ($this->{honour_suspend_certs} || $ignore)) { $this->{honour_suspend_certs} = 1; - closedown($this); - startup($this); + $this->closedown(); + $this->startup(); } return 1; @@ -3383,14 +3374,14 @@ sub switch_to_ws_root($$) if ($this->{cd_to_ws_root} && ! $switch) { $this->{cd_to_ws_root} = undef; - closedown($this); - startup($this); + $this->closedown(); + $this->startup(); } elsif (! $this->{cd_to_ws_root} && $switch) { $this->{cd_to_ws_root} = 1; - closedown($this); - startup($this); + $this->closedown(); + $this->startup(); } } else @@ -3654,7 +3645,7 @@ sub mtn_command($$$;@) my($this, $cmd, $ref, @parameters) = @_; - return mtn_command_with_options($this, $cmd, $ref, [], @parameters); + return $this->mtn_command_with_options($cmd, $ref, [], @parameters); } # @@ -3737,7 +3728,7 @@ sub mtn_command_with_options($$$$;@) # Startup the subordinate mtn process if it hasn't already been # started. - startup($this) if ($this->{mtn_pid} == 0); + $this->startup() if ($this->{mtn_pid} == 0); # Send the command. @@ -3785,7 +3776,7 @@ sub mtn_command_with_options($$$$;@) $db_locked_exception = $read_ok = $retry = 0; eval { - $read_ok = mtn_read_output($this, $buffer_ref); + $read_ok = $this->mtn_read_output($buffer_ref); }; $exception = $@; if ($exception ne "") @@ -3802,7 +3793,7 @@ sub mtn_command_with_options($$$$;@) # between a handled exit and one that should be dealt with. $in = undef; - closedown($this); + $this->closedown(); $db_locked_exception = 1; } @@ -3833,7 +3824,7 @@ sub mtn_command_with_options($$$$;@) if ($retry) { $in = undef; - closedown($this); + $this->closedown(); } else { @@ -4098,7 +4089,7 @@ sub startup($) # Get the interface version. - interface_version($this, \$version); + $this->interface_version(\$version); ($this->{mtn_aif_major}, $this->{mtn_aif_minor}) = ($version =~ m/^(\d+)\.(\d+)$/);