# # # patch "Monotone/AutomateStdio.pm" # from [be95616dc46ef8cc9743d5b5c9657116f196e2de] # to [49db9e335e4f284011126885c7d62dc1272dd332] # # patch "Monotone/AutomateStdio.pod" # from [a62e02b4a6dc8c2aa8f196d8c6dae7fe74c2bed7] # to [6215f5d9ff689f2e035bdce079c436b8f5be62e6] # # patch "TODO" # from [b384fec2b4f165da1aa814a1c0f8cc3c64b0d9f0] # to [599a84016a9e4b548be8a1a599e96db931e2addc] # # patch "mtn-tester" # from [29673726502ab0bc18945eb21e154b421ea0aa5f] # to [7db94b5966868140cece98d943fb83f6ba07b97b] # ============================================================ --- Monotone/AutomateStdio.pm be95616dc46ef8cc9743d5b5c9657116f196e2de +++ Monotone/AutomateStdio.pm 49db9e335e4f284011126885c7d62dc1272dd332 @@ -112,7 +112,6 @@ sub ancestry_difference(address@hidden;@); sub ancestors($\@@); sub ancestry_difference(address@hidden;@); -sub attributes($\$$); sub branches($\@); sub cert($$$$); sub certs($$$); @@ -125,6 +124,7 @@ sub error_message($); sub descendents($\@@); sub erase_ancestors($\@@); sub error_message($); +sub get_attributes($\$$); sub get_base_revision_id($\$); sub get_content_changed(address@hidden); sub get_corresponding_path($\$$$$); @@ -219,6 +219,10 @@ sub DESTROY my Monotone::AutomateStdio $this = shift(); closedown($this); + if ($this->can("SUPER::DESTROY")) + { + $this->SUPER::DESTROY(); + } } # @@ -287,33 +291,6 @@ sub ancestry_difference(address@hidden;@) # ############################################################################## # -# Routine - attributes -# -# Description - Get the attributes of the specified file. -# -# Data - $this : The object. -# \$buffer : A reference to a buffer that is to contain -# the output from this command. -# $file_name : The name of the file that is to be reported -# on. -# Return Value : True on success, otherwise false on failure. -# -############################################################################## - - - -sub attributes($\$$) -{ - - my Monotone::AutomateStdio $this = shift(); - my($buffer, $file_name) = @_; - - return mtn_command($this, "attributes", $buffer, $file_name); - -} -# -############################################################################## -# # Routine - branches # # Description - Get a list of branches. @@ -419,37 +396,36 @@ sub certs($$$) { if ($lines[$i] =~ m/^ *key \"/o) { - ($key) = ($lines[$i ++] =~ m/^ *key \"([^\"]+)\"$/o); - if ($lines[$i] =~ m/^ *signature \"/o) + get_quoted_value(@lines, $i, $key); + if ($lines[++ $i] =~ m/^ *signature \"/o) { ($signature) = - ($lines[$i ++] =~ m/^ *signature \"([^\"]+)\"$/o); + ($lines[$i] =~ m/^ *signature \"([^\"]+)\"$/o); } else { croak("Corrupt certs list, expected signature field but " . "didn't find it"); } - if ($lines[$i] =~ m/^ *name \"/o) + if ($lines[++ $i] =~ m/^ *name \"/o) { - ($name) = ($lines[$i ++] =~ m/^ *name \"([^\"]+)\"$/o); + get_quoted_value(@lines, $i, $name); } else { croak("Corrupt certs list, expected name field but didn't " . "find it"); } - if ($lines[$i] =~ m/^ *value \"/o) + if ($lines[++ $i] =~ m/^ *value \"/o) { get_quoted_value(@lines, $i, $value); - ++ $i; } else { croak("Corrupt certs list, expected value field but " . "didn't find it"); } - if ($lines[$i] =~ m/^ *trust \"/o) + if ($lines[++ $i] =~ m/^ *trust \"/o) { ($trust) = ($lines[$i] =~ m/^ *trust \"([^\"]+)\"$/o); } @@ -459,16 +435,16 @@ sub certs($$$) . "didn't find it"); } $$ref[$j ++] = {key => unescape($key), - signature => unescape($signature), + signature => $signature, name => unescape($name), value => unescape($value), - trust => unescape($trust)}; + trust => $trust}; } } - } + return 1; - return 1; + } } # @@ -689,6 +665,81 @@ sub erase_ancestors($\@@) # ############################################################################## # +# Routine - get_attributes +# +# Description - Get the attributes of the specified file. +# +# Data - $this : The object. +# $ref : A reference to a buffer or an array that is +# to contain the output from this command. +# $file_name : The name of the file that is to be reported +# on. +# Return Value : True on success, otherwise false on failure. +# +############################################################################## + + + +sub get_attributes($\$$) +{ + + my Monotone::AutomateStdio $this = shift(); + my($ref, $file_name) = @_; + + # Run the command and get the data, either as one lump or as a structured + # list. + + if (ref($ref) eq "SCALAR") + { + return mtn_command($this, "attributes", $ref, $file_name); + } + else + { + + my($i, + $j, + $key, + @lines, + $list, + $state, + $value); + + if (! mtn_command($this, "attributes", address@hidden, $file_name)) + { + return; + } + + # Reformat the data into a structured array. + + for ($i = $j = 0, @$ref = (); $i <= $#lines; ++ $i) + { + if ($lines[$i] =~ m/^ *attr \"/o) + { + ($list) = ($lines[$i] =~ m/^ *\S+ \"(.+)\"$/o); + ($key, $value) = split(/\" \"/o, $list); + if ($lines[++ $i] =~ m/^ *state \"/o) + { + ($state) = ($lines[$i] =~ m/^ *state \"([^\"]+)\"$/o); + } + else + { + croak("Corrupt attributes list, expected state field but " + . "didn't find it"); + } + $$ref[$j ++] = {attribute => unescape($key), + value => unescape($value), + state => $state}; + } + } + + return 1; + + } + +} +# +############################################################################## +# # Routine - get_base_revision_id # # Description - Get the revision upon which the workspace is based. @@ -987,10 +1038,9 @@ sub get_manifest_of($$;$) $type = undef; if ($lines[$i] =~ m/^ *file \"/o) { - $type = "f"; + $type = "file"; get_quoted_value(@lines, $i, $name); - ++ $i; - if ($lines[$i] =~ m/^ *content \[[^\]]+\]$/o) + if ($lines[++ $i] =~ m/^ *content \[[^\]]+\]$/o) { ($id) = ($lines[$i] =~ m/^ *content \[([^\]]+)\]$/o); } @@ -1002,12 +1052,12 @@ sub get_manifest_of($$;$) } if ($lines[$i] =~ m/^ *dir \"/o) { - $type = "d"; + $type = "directory"; get_quoted_value(@lines, $i, $name); } if ($type) { - if ($type eq "f") + if ($type eq "file") { $$ref[$j ++] = {type => $type, name => unescape($name), @@ -1021,9 +1071,9 @@ sub get_manifest_of($$;$) } } - } + return 1; - return 1; + } } # @@ -1068,8 +1118,8 @@ sub get_option($\$$) # revision. # # Data - $this : The object. -# \$buffer : A reference to a buffer that is to contain -# the output from this command. +# $ref : A reference to a buffer or an array that is +# to contain the output from this command. # $revision_id : The revision id which is to have its data # returned. # Return Value : True on success, otherwise false on failure. @@ -1082,10 +1132,169 @@ sub get_revision($\$$) { my Monotone::AutomateStdio $this = shift(); - my($buffer, $revision_id) = @_; + my($ref, $revision_id) = @_; - return mtn_command($this, "get_revision", $buffer, $revision_id); + # Run the command and get the data, either as one lump or as a structured + # list. + if (ref($ref) eq "SCALAR") + { + return mtn_command($this, "get_revision", $ref, $revision_id); + } + else + { + + my($attr, + $from_id, + $from_name, + $i, + $id, + $j, + @lines, + $name, + $to_id, + $to_name, + $value); + + if (! mtn_command($this, "get_revision", address@hidden, $revision_id)) + { + return; + } + + # Reformat the data into a structured array. + + for ($i = $j = 0, @$ref = (); $i <= $#lines; ++ $i) + { + if ($lines[$i] =~ m/^ *add_dir \"/o) + { + get_quoted_value(@lines, $i, $name); + $$ref[$j ++] = {type => "add_dir", + name => unescape($name)}; + } + elsif ($lines[$i] =~ m/^ *add_file \"/o) + { + get_quoted_value(@lines, $i, $name); + if ($lines[++ $i] =~ m/^ *content \[[^\]]+\]$/o) + { + ($id) = ($lines[$i] =~ m/^ *content \[([^\]]+)\]$/o); + } + else + { + croak("Corrupt revision, expected content field but " + . "didn't find it"); + } + $$ref[$j ++] = {type => "add_file", + name => unescape($name), + file_id => $id}; + } + elsif ($lines[$i] =~ m/^ *clear \"/o) + { + get_quoted_value(@lines, $i, $name); + if ($lines[++ $i] =~ m/^ *attr \"/o) + { + get_quoted_value(@lines, $i, $attr); + } + else + { + croak("Corrupt revision, expected attr field but didn't " + . "find it"); + } + $$ref[$j ++] = {type => "clear", + name => unescape($name), + attribute => unescape($attr)}; + } + elsif ($lines[$i] =~ m/^ *delete \"/o) + { + get_quoted_value(@lines, $i, $name); + $$ref[$j ++] = {type => "delete", + name => unescape($name)}; + } + elsif ($lines[$i] =~ m/^ *new_manifest \[[^\]]+\]$/o) + { + ($id) = ($lines[$i] =~ m/^ *new_manifest \[([^\]]+)\]$/o); + $$ref[$j ++] = {type => "new_manifest", + manifest_id => $id}; + } + elsif ($lines[$i] =~ m/^ *old_revision \[[^\]]+\]$/o) + { + ($id) = ($lines[$i] =~ m/^ *old_revision \[([^\]]+)\]$/o); + $$ref[$j ++] = {type => "old_revision", + revision_id => $id}; + } + elsif ($lines[$i] =~ m/^ *patch \"/o) + { + get_quoted_value(@lines, $i, $name); + if ($lines[++ $i] =~ m/^ *from \[[^\]]+\]$/o) + { + ($from_id) = ($lines[$i] =~ m/^ *from \[([^\]]+)\]$/o); + } + else + { + croak("Corrupt revision, expected from field but didn't " + . "find it"); + } + if ($lines[++ $i] =~ m/^ *to \[[^\]]+\]$/o) + { + ($to_id) = ($lines[$i] =~ m/^ *to \[([^\]]+)\]$/o); + } + else + { + croak("Corrupt revision, expected to field but didn't " + . "find it"); + } + $$ref[$j ++] = {type => "patch", + name => unescape($name), + from_file_id => $from_id, + to_file_id => $to_id}; + } + elsif ($lines[$i] =~ m/^ *rename \"/o) + { + get_quoted_value(@lines, $i, $from_name); + if ($lines[++ $i] =~ m/^ *to \"/o) + { + get_quoted_value(@lines, $i, $to_name); + } + else + { + croak("Corrupt revision, expected to field but didn't " + . "find it"); + } + $$ref[$j ++] = {type => "rename", + from_name => unescape($from_name), + to_name => unescape($to_name)}; + } + elsif ($lines[$i] =~ m/^ *set \"/o) + { + get_quoted_value(@lines, $i, $name); + if ($lines[++ $i] =~ m/^ *attr \"/o) + { + get_quoted_value(@lines, $i, $attr); + } + else + { + croak("Corrupt revision, expected attr field but didn't " + . "find it"); + } + if ($lines[++ $i] =~ m/^ *value \"/o) + { + get_quoted_value(@lines, $i, $value); + } + else + { + croak("Corrupt revision, expected value field but didn't " + . "find it"); + } + $$ref[$j ++] = {type => "set", + name => unescape($name), + attribute => unescape($attr), + value => unescape($value)}; + } + } + + return 1; + + } + } # ############################################################################## @@ -1136,9 +1345,9 @@ sub graph($$) parent_ids => address@hidden; } - } + return 1; - return 1; + } } # @@ -1288,11 +1497,10 @@ sub inventory($$) for ($i = $j = 0, @$ref = (); $i <= $#lines; ++ $i) { - $status = undef; if ($lines[$i] =~ m/^[A-Z ]{3} \d+ \d+ .+$/o) { ($status, $ref1, $ref2, $name) = - ($lines[$i ++] =~ m/^([A-Z ]{3}) (\d+) (\d+) (.+)$/o); + ($lines[$i] =~ m/^([A-Z ]{3}) (\d+) (\d+) (.+)$/o); $$ref[$j ++] = {status => $status, crossref_one => $ref1, crossref_two => $ref2, @@ -1300,9 +1508,9 @@ sub inventory($$) } } - } + return 1; - return 1; + } } # @@ -1324,8 +1532,8 @@ sub keys($$) sub keys($$) { - my Monotone::AutomateStdio $this = shift(); - my($ref, $revision_id) = @_; + my Monotone::AutomateStdio $this = $_[0]; + my $ref = $_[1]; # Run the command and get the data, either as one lump or as a structured # list. @@ -1341,6 +1549,7 @@ sub keys($$) $id, $j, @lines, + $list, $priv_hash, @priv_loc, $pub_hash, @@ -1380,15 +1589,8 @@ sub keys($$) } if ($lines[$i] =~ m/^ *public_location \"/o) { - if ($lines[$i] =~ m/^ *\S+ \"[^\"]+\" \"[^\"]+\"$/o) - { - @pub_loc = ($lines[$i ++] - =~ m/^ *\S+ \"([^\"]+)\" \"([^\"]+)\"$/o); - } - else - { - @pub_loc = ($lines[$i ++] =~ m/^ *\S+ \"([^\"]+)\"$/o); - } + ($list) = ($lines[$i ++] =~ m/^ *\S+ \"(.+)\"$/o); + @pub_loc = split(/\" \"/o, $list); } else { @@ -1397,21 +1599,13 @@ sub keys($$) } if ($i <= $#lines && $lines[$i] =~ m/^ *private_location \"/o) { - if ($lines[$i] =~ m/^ *\S+ \"[^\"]+\" \"[^\"]+\"$/o) - { - @priv_loc = ($lines[$i ++] - =~ m/^ *\S+ \"([^\"]+)\" \"([^\"]+)\"$/o); - } - else - { - @priv_loc = - ($lines[$i ++] =~ m/^ *\S+ \"([^\"]+)\"$/o); - } + ($list) = ($lines[$i ++] =~ m/^ *\S+ \"(.+)\"$/o); + @priv_loc = split(/\" \"/o, $list); } - if ($priv_hash) { - $$ref[$j ++] = {name => unescape($name), + $$ref[$j ++] = {type => "public-private", + name => unescape($name), public_hash => $pub_hash, private_hash => $priv_hash, public_locations => address@hidden, @@ -1419,9 +1613,10 @@ sub keys($$) } else { - $$ref[$j ++] = {name => unescape($name), - public_hash => $pub_hash, - public_locations => address@hidden; + $$ref[$j ++] = {type => "public", + name => unescape($name), + public_hash => $pub_hash, + public_locations => address@hidden; } } else @@ -1430,9 +1625,9 @@ sub keys($$) } } - } + return 1; - return 1; + } } # @@ -1600,31 +1795,35 @@ sub tags($$;$) if ($lines[$i] =~ m/^ *tag \"/o) { @branches = (); - ($tag) = ($lines[$i ++] =~ m/^ *tag \"([^\"]+)\"$/o); - if ($lines[$i] =~ m/^ *revision \[[^\]]+\]$/o) + get_quoted_value(@lines, $i, $tag); + if ($lines[++ $i] =~ m/^ *revision \[[^\]]+\]$/o) { - ($rev) = ($lines[$i ++] =~ m/^ *revision \[([^\]]+)\]$/o); + ($rev) = ($lines[$i] =~ m/^ *revision \[([^\]]+)\]$/o); } else { croak("Corrupt tags list, expected revision field but " . "didn't find it"); } - if ($lines[$i] =~ m/^ *signer \"/o) + if ($lines[++ $i] =~ m/^ *signer \"/o) { - ($signer) = ($lines[$i ++] =~ m/^ *signer \"([^\"]+)\"$/o); + get_quoted_value(@lines, $i, $signer); } else { croak("Corrupt tags list, expected signer field but " . "didn't find it"); } - if ($lines[$i] =~ m/^ *branches/o) + if ($lines[++ $i] =~ m/^ *branches/o) { if ($lines[$i] =~ m/^ *branches \".+\"$/o) { ($list) = ($lines[$i] =~ m/^ *branches \"(.+)\"$/o); @branches = split(/\" \"/o, $list); + for ($k = 0; $k <= $#branches; ++ $k) + { + $branches[$k] = unescape($branches[$k]); + } } } else @@ -1639,9 +1838,9 @@ sub tags($$;$) } } - } + return 1; - return 1; + } } # @@ -2000,7 +2199,7 @@ sub mtn_read_output($\$) } while ($size > 0 || $last eq "m"); - ++ $this->{cmd_cnt}; + ++ $this->{cmd_cnt}; # Deal with errors (message is in $$buffer). @@ -2071,10 +2270,13 @@ sub startup($) # Description - Get the contents of a quoted value that may span several # lines and contain escaped quotes. # -# Data - address@hidden : The reference to the list that is to contain -# the manifest. -# \$index : The id of the revision of the manifest that -# is to be fetched. +# Data - address@hidden : The reference to the list that contains the +# quoted string. +# \$index : The index of the line in the array +# containing the opening quote (assumed to be +# the first quote encountered). It is updated +# with the index of the line containing the +# closing quote at the end of the line. # \$buffer : A reference to a buffer that is to contain # the contents of the quoted string. # ============================================================ --- Monotone/AutomateStdio.pod a62e02b4a6dc8c2aa8f196d8c6dae7fe74c2bed7 +++ Monotone/AutomateStdio.pod 6215f5d9ff689f2e035bdce079c436b8f5be62e6 @@ -6,7 +6,7 @@ Monotone::automateStdio - Perl interface =head1 VERSION -0.1 +0.2 =head1 SYNOPSIS @@ -99,10 +99,6 @@ ancestors for the specified old revision Get a list of ancestors for the specified revision, that are not also ancestors for the specified old revisions. -=item $mtn->attributes(\$buffer, $file_name) - -Get the attributes of the specified file. - =item $mtn->branches(address@hidden) Get a list of branches. @@ -119,10 +115,12 @@ each one containing the following fields each one containing the following fields: key - The signer of the cert. - signature - Signer status, i.e. "ok" or "unknown". + signature - Signer status. Values can be one of "ok", "bad" or + "unknown". name - The cert name. value - Its value. - trust - Its trust status. + trust - Its trust status. Values can be one of "trusted" or + "untrusted". =item $mtn->children(address@hidden, $revision_id) @@ -166,6 +164,18 @@ Return the last error message received f Return the last error message received from the mtn subprocess. +=item $mtn->get_attributes(\$buffer, $file_name) + +Get the attributes of the specified file. If \$buffer is passed then the output +from the command is simply placed into the variable. However if address@hidden is +passed then the output is returned as a list of anonymous hashes, each one +containing the following fields: + + attribute - The name of the attribute. + value - The value of the attribute. + state - The status of the attribute. Values can be one of + "added", "changed", "dropped" or "unchanged". + =item $mtn->get_base_revision_id(\$buffer) Get the revision upon which the workspace is based. @@ -202,20 +212,63 @@ of anonymous hashes, each one containing variable. However if address@hidden is passed then the output is returned as a list of anonymous hashes, each one containing the following fields: - type - The type of entry, either "d" or "f" for directory and - file respectively. + type - The type of entry. Values can be one of "file" or + "directory". name - The name of the directory or file. - file_id - The Monotone id for the file's contents. This field is - only present if type is set to "f". + file_id - The id of the file. This field is only present if type + is set to "file". =item $mtn->get_option(\$buffer, $option_name) Get the value of an option stored in a workspace's _MTN directory. -=item $mtn->get_revision(\$buffer, $revision_id) +=item $mtn->get_revision(\$buffer | address@hidden, $revision_id) -Get the revision information for the current or specified revision. +Get the revision information for the current or specified revision. If \$buffer +is passed then the output from the command is simply placed into the +variable. However if address@hidden is passed then the output is returned as a list of +anonymous hashes, each one containing a variety of fields depending upon the +type of entry: + type - The type of entry. Values can be one of "add_dir", + "add_file", "clear", "delete", "new_manifest", + "old_revision", "patch", "rename" or "set". + + add_dir: + name - The name of the directory that was added. + + add_file: + name - The name of the file that was added. + file_id - The id of the file. + + clear: + name - The name of the file to which the attribute + applied. + attribute - The name of the attribute that was cleared. + + delete: + name - The name of the directory or file that was deleted. + + new_manifest: + manifest_id - The id of the revision's new manifest. + + old_revision: + old_revision - The id of the parent revision. + + patch: + name - The name of the file that was changed. + from_file_id - The file's old id. + to_file_id - The file's new id. + + rename: + from_name - The name of the file before the rename. + to_name - The name of the file after the rename. + + set: + name - The name of the file that had an attribute set. + attribute - The name of the attribute that was set. + value - The value that the attribute was set to. + =item $mtn->graph(\$buffer | address@hidden) Get a complete ancestry graph of the database. If \$buffer is passed then the @@ -258,15 +311,19 @@ containing the following fields: passed then the output is returned as a list of anonymous hashes, each one containing the following fields: + type - The type of entry. Values can be one of + "public" or "public-private". name - The name of the key. public_hash - The public hash code. - private_hash - The private has code. + private_hash - The private hash code. This field is only + present if type is set to "public-private". public_locations - A list of locations for the public hash code. Values can be one of "database" or "keystore". private_locations - A list of locations for the private hash code. Values can be one of "database" or - "keystore". + "keystore". This field is only present if + type is set to "public-private". =item $mtn->leaves(address@hidden) @@ -346,6 +403,6 @@ No doubt other bugs will crawl out of th =head1 HISTORY -An original my Anthony Cooper . +An original by Anthony Cooper . =cut ============================================================ --- TODO b384fec2b4f165da1aa814a1c0f8cc3c64b0d9f0 +++ TODO 599a84016a9e4b548be8a1a599e96db931e2addc @@ -1,4 +1,5 @@ -1) Implement structuring of data for the $mtn->attributes() and $mtn->revision() - methods. -2) Sort out a test database for use with a mtn-tester +1) Update to version from 0.35 to 0.37. +2) Implement conditional chained constructor. +2) Sort out a test database for use with a mtn-tester (use a script to generate + the database rather than use a static db). 3) Do CPAN stuff. ============================================================ --- mtn-tester 29673726502ab0bc18945eb21e154b421ea0aa5f +++ mtn-tester 7db94b5966868140cece98d943fb83f6ba07b97b @@ -1,5 +1,7 @@ #!/usr/bin/perl -w +use lib "/home/aecoope/perl"; + use strict; use integer; use Carp; @@ -16,180 +18,189 @@ my($data, @list, $mtn); -$mtn = Monotone::AutomateStdio->new("test.mtn"); +$mtn = Monotone::AutomateStdio->new("/home/aecoope/perl/test.mtn"); # $mtn = Monotone->new(); if (0) { -if (! $mtn->branches(address@hidden)) -{ - printf("OOPS: %s\n", $mtn->error_message()); -} -else -{ - print Dumper(address@hidden); -} -if (! $mtn->certs(address@hidden, "ae65e53a3beca7841a87eb4525f39e3369107b82")) -{ - printf("OOPS: %s\n", $mtn->error_message()); -} -else -{ - print Dumper(address@hidden); -} -if (! $mtn->cert("ae65e53a3beca7841a87eb4525f39e3369107b82", "status", - "EXTERMINATE")) -{ - printf("OOPS: %s\n", $mtn->error_message()); -} -if (! $mtn->children(address@hidden, "78bfd27c26a0c8ac249f30293e6ef6d5f44e6084")) -{ - printf("OOPS: %s\n", $mtn->error_message()); -} -else -{ - print Dumper(address@hidden); - printf("Largest valid index = %d\n", $#list); -} -if (! $mtn->children(address@hidden, "ae65e53a3beca7841a87eb4525f39e3369107b82")) -{ - printf("OOPS: %s\n", $mtn->error_message()); -} -else -{ - print Dumper(address@hidden); -} -if (! $mtn->ancestry_difference(address@hidden, - "ed89ce366c3316f189f01229adc863b3285130e2", - "65e51cd2a00b4ee60b9fcc356e8e503d1e690414")) -{ - printf("OOPS: %s\n", $mtn->error_message()); -} -else -{ - print "DIFF\n"; - print Dumper(address@hidden); -} -if (! $mtn->common_ancestors(address@hidden, + if (! $mtn->branches(address@hidden)) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + else + { + print Dumper(address@hidden); + } + if (! $mtn->certs(address@hidden, "ae65e53a3beca7841a87eb4525f39e3369107b82")) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + else + { + print Dumper(address@hidden); + } + if (! $mtn->cert("ae65e53a3beca7841a87eb4525f39e3369107b82", "status", + "EXTERMINATE")) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + if (! $mtn->children(address@hidden, "78bfd27c26a0c8ac249f30293e6ef6d5f44e6084")) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + else + { + print Dumper(address@hidden); + printf("Largest valid index = %d\n", $#list); + } + if (! $mtn->children(address@hidden, "ae65e53a3beca7841a87eb4525f39e3369107b82")) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + else + { + print Dumper(address@hidden); + } + if (! $mtn->ancestry_difference(address@hidden, + "ed89ce366c3316f189f01229adc863b3285130e2", + "65e51cd2a00b4ee60b9fcc356e8e503d1e690414")) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + else + { + print "DIFF\n"; + print Dumper(address@hidden); + } + if (! $mtn->common_ancestors(address@hidden, + "ae65e53a3beca7841a87eb4525f39e3369107b82", + "78bfd27c26a0c8ac249f30293e6ef6d5f44e6084", + "ff7e085fab7385fbaabc57c1f53a9bbea59bf132")) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + else + { + print Dumper(address@hidden); + } + if (! $mtn->content_diff(\$data, "ae65e53a3beca7841a87eb4525f39e3369107b82", - "78bfd27c26a0c8ac249f30293e6ef6d5f44e6084", - "ff7e085fab7385fbaabc57c1f53a9bbea59bf132")) -{ - printf("OOPS: %s\n", $mtn->error_message()); -} -else -{ - print Dumper(address@hidden); -} -if (! $mtn->content_diff(\$data, - "ae65e53a3beca7841a87eb4525f39e3369107b82", - "d612b1ed732ea565085eede32bb2a1fae2ca8804")) -{ - printf("OOPS: %s\n", $mtn->error_message()); -} -else -{ - print Dumper(\$data); -} -if (! $mtn->content_diff(\$data, - "ae65e53a3beca7841a87eb4525f39e3369107b82", - "d612b1ed732ea565085eede32bb2a1fae2ca8804", - "Makefile")) -{ - printf("OOPS: %s\n", $mtn->error_message()); -} -else -{ - print Dumper(\$data); -} -if (! $mtn->descendents(address@hidden, "d612b1ed732ea565085eede32bb2a1fae2ca8804")) -{ - printf("OOPS: %s\n", $mtn->error_message()); -} -else -{ - print Dumper(address@hidden); -} -if (! $mtn->erase_ancestors(address@hidden, - "ae65e53a3beca7841a87eb4525f39e3369107b82", - "d612b1ed732ea565085eede32bb2a1fae2ca8804")) -{ - printf("OOPS: %s\n", $mtn->error_message()); -} -else -{ - print Dumper(address@hidden); -} -if (! $mtn->get_base_revision_id(\$data)) -{ - printf("OOPS: %s\n", $mtn->error_message()); -} -else -{ - print Dumper(\$data); -} -if (! $mtn->get_content_changed(address@hidden, + "d612b1ed732ea565085eede32bb2a1fae2ca8804")) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + else + { + print Dumper(\$data); + } + if (! $mtn->content_diff(\$data, + "ae65e53a3beca7841a87eb4525f39e3369107b82", + "d612b1ed732ea565085eede32bb2a1fae2ca8804", + "Makefile")) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + else + { + print Dumper(\$data); + } + if (! $mtn->descendents(address@hidden, "d612b1ed732ea565085eede32bb2a1fae2ca8804")) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + else + { + print Dumper(address@hidden); + } + if (! $mtn->erase_ancestors(address@hidden, "ae65e53a3beca7841a87eb4525f39e3369107b82", - "Makefile")) -{ - printf("OOPS: %s\n", $mtn->error_message()); + "d612b1ed732ea565085eede32bb2a1fae2ca8804")) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + else + { + print Dumper(address@hidden); + } + if (! $mtn->get_base_revision_id(\$data)) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + else + { + print Dumper(\$data); + } + if (! $mtn->get_content_changed(address@hidden, + "ae65e53a3beca7841a87eb4525f39e3369107b82", + "Makefile")) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + else + { + print Dumper(address@hidden); + } + if (! $mtn->get_corresponding_path + (\$data, + "ae65e53a3beca7841a87eb4525f39e3369107b82", + "Makefile", + "d612b1ed732ea565085eede32bb2a1fae2ca8804")) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + else + { + print Dumper(\$data); + } + if (! $mtn->get_current_revision_id(\$data)) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + else + { + print Dumper(\$data); + } + if (! $mtn->get_file(\$data, "f7bec98218953adbb833865ccc52ea74d410b24e")) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + else + { + print $data; + } + if (! $mtn->get_file_of(\$data, "Makefile")) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + else + { + print $data; + } + if (! $mtn->get_option(\$data, "database")) + { + printf("OOPS: %s\n", $mtn->error_message()); + } + else + { + print $data; + } } -else + +if (! $mtn->get_attributes(\$data, "script2")) { - print Dumper(address@hidden); -} -if (! $mtn->get_corresponding_path - (\$data, - "ae65e53a3beca7841a87eb4525f39e3369107b82", - "Makefile", - "d612b1ed732ea565085eede32bb2a1fae2ca8804")) -{ printf("OOPS: %s\n", $mtn->error_message()); } else { - print Dumper(\$data); -} -if (! $mtn->get_current_revision_id(\$data)) -{ - printf("OOPS: %s\n", $mtn->error_message()); -} -else -{ - print Dumper(\$data); -} -if (! $mtn->get_file(\$data, "f7bec98218953adbb833865ccc52ea74d410b24e")) -{ - printf("OOPS: %s\n", $mtn->error_message()); -} -else -{ print $data; } -if (! $mtn->get_file_of(\$data, "Makefile")) -{ - printf("OOPS: %s\n", $mtn->error_message()); -} -else -{ - print $data; -} -if (! $mtn->get_option(\$data, "database")) -{ - printf("OOPS: %s\n", $mtn->error_message()); -} -else -{ - print $data; -} -} -if (! $mtn->attributes(\$data, "README")) +if (! $mtn->get_attributes(address@hidden, "script2")) { printf("OOPS: %s\n", $mtn->error_message()); } else { - print $data; + print Dumper(address@hidden); } if (! $mtn->branches(address@hidden)) @@ -413,6 +424,24 @@ else print Dumper(address@hidden); } +if (! $mtn->get_revision(\$data, "492d55d26d09e8358bc239eaf2bf422350bf2d13")) +{ + printf("OOPS: %s\n", $mtn->error_message()); +} +else +{ + print Dumper(\$data); +} + +if (! $mtn->get_revision(address@hidden, "492d55d26d09e8358bc239eaf2bf422350bf2d13")) +{ + printf("OOPS: %s\n", $mtn->error_message()); +} +else +{ + print Dumper(address@hidden); +} + printf("Last error message `%s'\n", $mtn->error_message()); print Dumper (\$mtn);