Arch::Storage(3pm)

πŸ“¦ version 0.5.2, in ubuntu jammy

✨ Arch::Storage ✨

okay bestie, welcome to Arch::Storage(3pm) β€” that's the User Contributed Perl Documentation version, and yes it's giving vintage 2005 but we love her anyway πŸ’–


🌸 NAME 🌸

Arch::Storage β€” an abstract class to access arch archives. no cap, that's literally her whole job description.


πŸŽ€ SYNOPSIS πŸŽ€

use base 'Arch::Storage';

# see synopsis of concrete classes

so like, you don't instantiate her, she's abstract, she's the blueprint πŸ’… go look at the concrete classes for the real tea.


πŸ¦‹ DESCRIPTION πŸ¦‹

Arch::Storage hands out some common methods for querying the content of an arch archive. she's the mom friend of the class hierarchy.

The methods usually return an arrayref unless it says otherwise, and they are not affected by list context β€” except for working_names, who is the one exception, main character behavior honestly ✨


πŸ’… METHODS πŸ’…

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). fresh out the box, brand new, iconic 🫢


⭐ instance

Alternative constructor. Returns the last created instance of the concrete subclass (i.e. Arch::Session or Arch::Library) β€” or makes a new one if there isn't one yet.

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.

ngl that's a lot of words but it's real, bestie β€” multiple objects = pick one of those two paths, no third option πŸ’€


⭐ init %args

Initialize or reset the object state. factory reset energy ✨


⭐ 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 an Arch::Name instance, and that is what gets returned. Note that this object behaves as a 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 an arrayref, and call to_array on the returned object. iykyk πŸ“


⭐ fixup_name_alias

Replace (if needed) the "FIRST" and "LATEST" components of the working name's version and revision with the actual values by querying the storage. she goes and finds out the truth for you πŸ”₯


⭐ 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.


⭐ expanded_revisions

Return all revisions in all archives, each revision is an Arch::Name object. every single one. she does not gatekeep πŸ’œ


⭐ archives

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 a 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:

  • name β€” The revision name (i.e. "base-0", "patch-X", "version-0" or "versionfix-X") ✨
  • summary β€” The revision's commit log's summary line
  • creator β€” The name part of the committer's "tla my-id" (i.e. "John Hacker")
  • email β€” The email address part of the committer's "tla my-id" (i.e. "jhacker@nowhere.org")
  • date β€” The revision's commit date in "%Y-%m-%d %H:%M:%S %Z" format (see strftime(3))
  • kind β€” 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 a 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" ],
          ...
        ],
        ...
      ],
      ...
    ]

it's giving nested data structure realness 🌈


⭐ 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 / get_log

Fetch the log for the revision or working_name. Returns an Arch::Log object. πŸŽ€


πŸ’€ BUGS πŸ’€

No known bugs. she's flawless, periodt πŸ‘‘


πŸ‘‘ AUTHORS πŸ‘‘

Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel).

Enno Cramer (uebergeek@web.de--2003/arch-perl--devel).


🌈 SEE ALSO 🌈

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


and that's the whole page bestie!! πŸ’– she's documented by perl v5.20.2, dated 2005-05-16, and honestly? an icon, a legend, the moment. go query some archives, slay, and remember: abstract classes don't get instantiated πŸ¦‹βœ¨

πŸ“¦ where this page comes from