View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Mikhael Goikhman > Arch-0.5.2 > Arch::Storage



Annotate this POD


New  1
Open  0
View/Report Bugs


Arch::Storage - abstract class to access arch archives


    use base 'Arch::Storage';

    # see synopsis of concrete classes


Arch::Storage provides some common methods to query content of arch archive.

The methods usually return arrayref if not otherwise specified, and are not affected by the list context (except for working_names).


The following (implemented and pure virtual) methods are common to subclasses:

new, init, working_name, working_names, fixup_name_alias, is_archive_managed, expanded_revisions.

archives, categories, branches, versions, revisions, get_revision_descs, expanded_archive_info, get_revision_changeset, get_changeset, get_revision_log, get_log.

new [%args]

Create a new instance of the concrete subclass (i.e. Arch::Session or Arch::Library).


Alternative constructor. Return the last created instance of the concrete subclass (i.e. Arch::Session or Arch::Library) or create a new one.

The purpose of this alternative constructor is to allow the singleton behaviour as well as certain Aspect Oriented Programming practices.

Theoretical note: this design is acceptably good, and mixing new and instance constructors in the code usually does what is intended. However, if someone actually creates more than one object of any subclass, he has two choices to enforce correctness. Either only use instance method in the code (singleton pattern), or alternatively create a temporary new object before calling methods of other classes that internally use instance to work with this subclass.

init %args

Initialize or reset the object state.

working_name [name]

Set or get the default working operand for other methods.

The argument may be anything that Arch::Name constructor accepts, i.e. fully qualified string, arrayref, hashref or Arch::Name instance. If needed, name is converted to Arch::Name instance, and this is what is returned. Note that this object behaves as fully qualified name in string context.

working_names [archive ..]

Similar to working_name, but accepts and returns a list of name components, from archive to revision.

This method is provided for convenience and backward compatibility only. You may as well use working_name instead, just enclose the argument list into arrayref, and call to_array on the returned object.


Replace (if needed) the "FIRST" and "LATEST" components of the working name's version and revision with the actual values by querying the storage.

is_archive_managed [archive]

Return true or false depending on whether the archive is known to the storage.

If given, the argument is used instead of the default working_name.


Return all revisions in all archives, each revision is Arch::Name object.


Return all registered (or otherwise known) archives.

categories [archive]
branches [category]
versions [branch]
revisions [version]

Return all categories, branches, versions or revisions respectively in the immediate parent, similarly to the corresponding tla commands.

If given, the argument is used instead of the default working_name.

get_revision_descs [version]

Return describing hash for every revision in the version.

If given, the argument is used instead of the default working_name.

The revision hashes have the following fields:


The revision name (i.e. base-0, patch-X, version-0 or versionfix-X)


The revision's commit log's summary line


The name part of the committers tla my-id (i.e. John Hacker)


The email address part of the committers tla my-id (i.e.


The revisions commit date in %Y-%m-%d %H:%M:%S %Z format (see strftime(3))


The kind of revision (i.e. one of tag, import, cset or unknown)

expanded_archive_info [archive]

Returns a tree of categories, branches and versions in the archive. The archive defaults to working_names.

Returns a reference to a list of categories. Every category is a list consisting of the category name and a list of branches. Every branch is a list consisting of the branch name and a list of versions. Every version is list consisting of the version number and the first and last revision name.

      [ "category1", [
        [ "branch1", [
          [ "version1", "first_revision1", "last_revision1" ],
          [ "version2", "first_revision2", "last_revision2" ],
get_revision_changeset revision [dir]
get_changeset [dir]

Fetches the changeset for revision or working_name and returns an Arch::Changeset for it. If dir is specified, it will be used to store the contents of the changeset. Otherwise a new temporary directory will be created.

get_revision_log revision

Fetch the log for the revision or working_name. Returns an Arch::Log object.


No known bugs.


Mikhael Goikhman (

Enno Cramer (


For more information, see tla, Arch::Session, Arch::Library.

syntax highlighting: