Package pybaz :: Class Version
[frames] | no frames]

Class Version

source code

     object --+                
              |                
NamespaceObject --+            
                  |            
        ArchiveItem --+        
                      |        
           CategoryItem --+    
                          |    
                 BranchItem --+
                              |
     object --+               |
              |               |
NamespaceObject --+           |
                  |           |
        ArchiveItem --+       |
                      |       |
              Setupable --+   |
                          |   |
         object --+       |   |
                  |       |   |
    NamespaceObject --+   |   |
                      |   |   |
       RevisionIterable --+   |
                          |   |
                    Package --+
                              |
             object --+       |
                      |       |
        NamespaceObject --+   |
                          |   |
           RevisionIterable --+
                              |
                             Version

Arch version namespace object.

:see: `Archive`, `Category`, `Branch`, `Revision`



Instance Methods
 
__getitem__(self, idx)
Instanciate a revision belonging to this version.
 
__init__(self, name)
Create a Version object from its name.
 
as_version(self)
Deprecated.
 
exists(self)
Does this namespace exists? Within the Arch model, history cannot be changed: created archive entries cannot be deleted.
 
get(self, dir, link=False)
Construct a project tree for this version.
 
get_library_revisions(self, reverse=False)
Deprecated.
 
get_revisions(self, reverse=False)
Deprecated.
 
iter_cachedrevs(self)
Iterate over the cached revisions in this version.
 
iter_library_revisions(self, reverse=False)
Iterate over library revisions.
 
iter_location_revisions(self, location)
Revisions present in this version at specified archive location.
 
iter_merges(self, other=None, reverse=False, metoo=True)
Iterate over merge points in this version.
 
iter_revisions(self, reverse=False)
Iterate over archive revisions.

Inherited from BranchItem: get_branch

Inherited from CategoryItem: get_category

Inherited from Package: as_revision, latest_revision

Inherited from Setupable: setup

Inherited from ArchiveItem: get_archive, get_fullname, get_nonarch

Inherited from NamespaceObject: __eq__, __ne__, __repr__, __str__

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Properties
  library_revisions
Deprecated.
  revisions
Deprecated.

Inherited from BranchItem: branch

Inherited from CategoryItem: category

Inherited from ArchiveItem: archive, fullname, nonarch

Inherited from object: __class__

Method Details

__getitem__(self, idx)
(Indexing operator)

 
Instanciate a revision belonging to this version.

Given a string, instanciate the revision of this version with the given
patchlevel. For example
``Version('jdoe@example.com/frob--devel--0')['patch-1']`` is equivalent
to ``Revision('jdoe@example.com/frob--devel--0--patch-1')``.

Given an integer, instanciate the *existing* revision of this version
with the given index. For example, if ``version`` contains at least one
revision, ``version[0]`` is equivalent to ``version['base-0']``, and
``version[-1]`` is equivalent to ``version.latest_revision()``.

:param idx: patch level, or revision number
:type idx: str, int
:rtype: `Revision`

:raise NamespaceError: argument is a string not a valid version
    patchlevel.
:raise ValueError: argument is an integer and the version contains no
    revision with that index.

__init__(self, name)
(Constructor)

 
Create a Version object from its name.

:param name: fully-qualified version name, like
   "jdoe@example.com--2004/frob--devo--1.2".
:type name: str

:note: Nameless branches have no "branch" part in their name.

Overrides: ArchiveItem.__init__

as_version(self)

 
Deprecated.

This version.

:rtype: `Version`

exists(self)

 
Does this namespace exists?

Within the Arch model, history cannot be changed: created archive
entries cannot be deleted. However, it is possible to ``unregister`` an
archive, or to find references to archives whose location is not known.
Thus, existence cannot always be decided. Testing for the existence of
a name in a non-registered archive raises
`errors.ArchiveNotRegistered`.

:return: whether this namespace object exists.
:rtype: bool
:raise errors.ArchiveNotRegistered: the archive name is not registered,
    so existence cannot be decided.
:raise errors.ExecProblem: there was a problem accessing the archive.

Overrides: NamespaceObject.exists
(inherited documentation)

get(self, dir, link=False)

 
Construct a project tree for this version.

Extract the latest revision for this version from the archive. That is
a shortcut for ``version.latest_revision.get(dir)``. It can be
susceptible to race conditions when a concurrent transaction occurs on
the same version, yielding a latter revision that what you may have
meant.

:param dir: path of the project tree to create. Must not
    already exist.
:type dir: str
:param link: hardlink files to revision library instead of copying
:type link: bool
:return: newly created project tree.
:rtype: `WorkingTree`

get_library_revisions(self, reverse=False)

 
Deprecated.

Revisions in this version present in the library.

:rtype: tuple of `Revision`
:see: `iter_library_revisions`

get_revisions(self, reverse=False)

 
Deprecated.

Revisions in this version.

:rtype: tuple of `Revision`
:see: `iter_revisions`

iter_cachedrevs(self)

 
Iterate over the cached revisions in this version.

:rtype: iterator of `Revision`

iter_library_revisions(self, reverse=False)

 
Iterate over library revisions.

:param reverse: reverse order, recent revisions first.
:type reverse: bool
:return: revisions in this namespace which are present in the
    revision library.
:rtype: iterable of `Revision`

Overrides: RevisionIterable.iter_library_revisions
(inherited documentation)

iter_location_revisions(self, location)

 
Revisions present in this version at specified archive location.

:warning: This is a temporary facility that does no sanity checking. It
will be removed shortly after bound namespace objects are properly
implemented.

iter_merges(self, other=None, reverse=False, metoo=True)

 
Iterate over merge points in this version.

This method is mostly useful to save multiple invocations of
the command-line tool and multiple connection to a remote
archives when building an ancestry graph. Ideally, it would
not be present and the desired merge graph traversal would be
done using the new_patches and merges properties of Patchlog
objects.

:param other: list merges with that version.
:type other: `Version`
:param reverse: reverse order, recent revisions first.
:type reverse: bool
:param metoo: do not report the presence of a patch within itself
:type metoo: bool

:return: Iterator of tuples (R, T) where R are revisions in this
    version and T are iterable of revisions in the ``other`` version.
:rtype: iterable of `Revision`

iter_revisions(self, reverse=False)

 
Iterate over archive revisions.

:param reverse: reverse order, recent revisions first.
:type reverse: bool
:return: all existing revisions in this namespace.
:rtype: iterable of `Revision`

:precondition: `self.exists()` returns ``True``.

Overrides: RevisionIterable.iter_revisions
(inherited documentation)

Property Details

library_revisions


Deprecated.

Revisions in this version present in the library.

:type: tuple of `Revision`
:see: `iter_library_revisions`

Get Method:
pybaz.Version._get_library_revisions(self)

revisions


Deprecated.

Revisions in this version.

:type: tuple of `Revision`
:see: `iter_revisions`

Get Method:
pybaz.Version._get_revisions(self)