Arch::RevisionBunches(3pm) | User Contributed Perl Documentation | Arch::RevisionBunches(3pm) |
Arch::RevisionBunches - manage bunches of related revisions
use Arch::RevisionBunches; use Arch::Tree; my $rb = Arch::RevisionBunches->new; my $tree = Arch::Tree->new(".", own_logs => 1); $rb->add_revision_descs($tree->get_history_revision_descs); $rb->rebunch(25); # the default is 50 foreach my $bunch ($rb->get) { print "$bunch->{version}\n"; print " $_->{name}\t$_->{summary}\n" foreach @{$bunch->{revision_descs}}; } foreach my $bunch ($rb->reverse_revision_descs->rebunch(30)) { print $bunch->{name1}; print " .. $bunch->{name2}" if $bunch->{name2}; print " ($bunch->{daysago1}"; print " .. $bunch->{daysago2}" if $bunch->{name2}; print " days ago)\n"; }
This class helps front-ends to group revisions. Such grouping is essential when, for example, the version to be shown contains thousands of revisions. The front-end may decide to show expandable bunches of 100 revisions each.
There is a support for revision descriptions (summary, date, creator, email, and in some cases associated the file name and/or the associated version). There is a constraint by convention, one bunch may only contain revisions of the same version, and the ones associated with the same file if applicable. It is possible to define an order of versions. It is possible to recreate bunches (rebunch) using a different number of revisions. The constraint defines the actual number of revisions in different bunches, it is not guaranteed to be the same.
The following methods are available:
new, init, add_revision_descs, versions, rebunch, get, clear, reverse_revision_descs, versions, filepaths.
The %args are passed to init method.
Return the object, this enables chaining of get or rebunch method call.
Return the same get does.
Each bunch is hashref with keys:
revision_descs name1 daysago1 time1 tz1 name2 daysago2 time2 tz2 size num_creators num_other_creators main_creator main_email creator name date summary
and optionally "version", "is_missing" and "filepath" if applicable.
This method implicitly calls rebunch with no parameter if new revision descriptions were added that are not bunched yet.
Return the object, this enables chaining of get or rebunch method call.
Waiting for your reports.
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel).
For more information, see Arch::Tree, Arch::Log, Arch::Session, Arch::Library.
2005-02-21 | perl v5.20.2 |