Arch::Tree(3pm) | User Contributed Perl Documentation | Arch::Tree(3pm) |
Arch::Tree - class representing Arch tree
use Arch::Tree; my $tree = Arch::Tree->new; # assume the current dir print map { "$_\n" } $tree->get_log_versions; foreach my $log ($tree->get_logs) { print "-" x 80, "\n"; print $log->standard_date, "\n"; print $log->summary, "\n\n"; print $log->body; }
This class represents the working tree concept in Arch and provides some useful methods.
The following methods are available:
new, root, get_version, set_version, get_log_versions, add_log_version, get_log_revisions, get_log, get_logs, get_log_revision_descs, get_inventory, get_changes, get_changeset, get_merged_log_text, get_merged_revision_summaries, get_merged_revisions, get_missing_revisions, get_missing_revision_descs, get_previous_revision, get_ancestry_logs, get_history_revision_descs, get_annotate_revision_descs, clear_cache, add, delete, mode, get_file_diff, make_log, import, commit.
The default version is the tree version (see "get_version"). A special version name '*' may be used, in this case all logs in "get_log_versions" are returned. version may be arrayref as well with the similar results.
The default version is the tree version (see "get_version").
The default version is the tree version (see "get_version").
%args accepts: flags no_continuation and one_version, and callback to filter a revision log before it is collected.
If no_continuation is set, then do not follow tags backward.
If one_version is set, then do not follow tags from the versions different than the initial version. This is similar to no_continuation, but not the same, since it is possible to tag into the same version.
The default callback is effectivelly:
sub { my ($log) = @_; return $log; }
Note that if the callback does $_[0] = undef among other things, this is taken as a signal to stop processing of ancestry (the return value is still collected even in this case; return empty list to collect nothing).
If filepath if given, then the revision description hash additionally contains keys filepath, orig_filepath (if renamed on that revision), is_filepath_added, is_filepath_renamed and is_filepath_modified.
%args accepts: flags no_continuation and one_version, and callback to filter a revision description before it is collected.
The default callback is effectivelly:
sub { my ($revision_desc, $log) = @_; return $revision_desc; }
The %args flags and assigning to $_[0] in callback have the same meaning as in get_ancestry_logs.
($lines, $line_revision_desc_indexes, $revision_descs) = $tree->get_annotate_revision_descs($filename);
$lines is arrayref that contains all filepath lines with no end-of-line; $line_revision_desc_indexes is arrayref of the same length that contains indexes to the $revision_descs arrayref. Note that $revision_descs is the same returned in the scalar context, it is similar to the one returned by get_history_revision_descs, but possibly contains less elements, since some revisions only modified metadata, or only modified lines that were modified by other revisions afterward, all such revisions are not included.
If some lines can't be annotated (usually, because the history was cut), then the corresonding $line_revision_desc_indexes elements are undefined.
%args accepts: flags no_continuation and one_version, and callback to filter a revision description before it is collected.
The default callback is effectivelly:
sub { my ($revision_desc, $log) = @_; return $revision_desc; }
The %args flags and assigning to $_[0] in callback have the same meaning as in get_ancestry_logs and get_history_revision_descs.
Additionally, prefetch_callback is supported. If given, it is called before fetching a changeset, with two arguments: revision, and filename to look at the patch of which.
More %args keys are linenums (either string or arrayref or hashref), match_re (regular expression to filter lines). And flags highlight (syntax highlight lines using markup), full_history (include all file history revision even those that didn't add the current file lines).
By default all cached keys are cleared; key may be one of the strings 'missing_revision_descs', 'missing_revisions'.
Note, version argument is not supported in newer baz versions.
Optional file limits may be passed using files arrayref in options.
Awaiting for your reports.
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel).
Enno Cramer (uebergeek@web.de--2003/arch-perl--devel).
For more information, see tla, Arch::Log, Arch::Inventory, Arch::Changes, Arch::Util, Arch::Name.
2005-11-14 | perl v5.20.2 |