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

Class Revision

source code

     object --+                    
              |                    
NamespaceObject --+                
                  |                
        ArchiveItem --+            
                      |            
           CategoryItem --+        
                          |        
                 BranchItem --+    
                              |    
                    VersionItem --+
                                  |
                                 Revision

Arch revision namespace object.

:see: `Archive`, `Category`, `Branch`, `Version`
:group Libray Methods: library_add, library_remove, library_find
:group History Methods: get_ancestor, get_previous, iter_ancestors



Instance Methods
 
__init__(self, name)
Create a Revision object from its name.
 
apply(self, tree, reverse=False)
Replay this revision on this tree.
 
as_revision(self)
Deprecated Returns this revision.
 
cache(self, cache=None)
Cache a full source tree for this revision in its archive.
 
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 revision.
 
get_ancestor(self)
Deprecated.
 
get_patch(self, dir)
Fetch the changeset associated to this revision.
 
get_patchlog(self)
Deprecated.
 
get_previous(self)
Deprecated.
 
iter_ancestors(self, metoo=False)
Ancestor revisions.
 
iter_files(self)
Files stored in the archive for that revision.
 
library_add(self)
Add this revision to the library.
 
library_find(self)
The copy of this revision in the library.
 
library_remove(self)
Remove this revision from the library.
 
make_continuation(self, target)
Create a continuation of this revision in the target version.
 
uncache(self)
Remove the cached tree of this revision from its archive.

Inherited from VersionItem: get_branch, get_patchlevel, get_version

Inherited from CategoryItem: get_category

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
  ancestor
Parent revision.
  patchlog
Patchlog associated to this revision.
  previous
Previous namespace revision.

Inherited from VersionItem: branch, patchlevel, version

Inherited from CategoryItem: category

Inherited from ArchiveItem: archive, fullname, nonarch

Inherited from object: __class__

Method Details

__init__(self, name)
(Constructor)

 
Create a Revision object from its name.

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

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

Overrides: VersionItem.__init__

apply(self, tree, reverse=False)

 
Replay this revision on this tree. Raise on conflict.

:param tree: the tree to apply changes to.
:type tree: `WorkingTree`
:param reverse: invert the meaning of the changeset; adds
    become deletes, etc.
:type reverse: bool
:raise errors.ChangesetConflict: a conflict occured while replaying the
    revision.

as_revision(self)

 
Deprecated

Returns this revision. For consistency with `Package.as_revision()`.

:rtype: `Revision`

cache(self, cache=None)

 
Cache a full source tree for this revision in its archive.

:param cache: cache root for trees with pristines.
:type cache: bool

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

Extract this revision from the archive.

: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_ancestor(self)

 
Deprecated.

Parent revision.

:return:
    - The previous namespace revision, if this revision is regular
      commit.
    - The tag origin, if this revision is a continuation
    - ``None`` if this revision is an import.

:rtype: `Revision` or None
:see: `Revision.ancestor`

get_patch(self, dir)

 
Fetch the changeset associated to this revision.

:param dir: name of the changeset directory to create. Must
    not already exist.
:type dir: str
:return: changeset associated to this revision.
:rtype: `Changeset`

get_patchlog(self)

 
Deprecated.

Patchlog associated to this revision.

:rtype: `Patchlog`
:see: `Revision.patchlog`

get_previous(self)

 
Deprecated.

Previous namespace revision.

:return: the previous revision in the same version, or None if this
    revision is a ``base-0``.
:rtype: `Revision` or None
:see: `Revision.previous`

iter_ancestors(self, metoo=False)

 
Ancestor revisions.

:param metoo: yield ``self`` as the first revision.
:type metoo: bool
:return: all the revisions in that line of development.
:rtype: iterable of `Revision`

iter_files(self)

 
Files stored in the archive for that revision.

:rtype: iterable of `RevisionFile`

library_add(self)

 
Add this revision to the library.

:postcondition: self in self.version.iter_library_revisions()

library_find(self)

 
The copy of this revision in the library.

:rtype: `LibraryTree`
:precondition: self in self.version.iter_library_revisions()

library_remove(self)

 
Remove this revision from the library.

:precondition: self in self.version.iter_library_revisions()
:postcondition: self not in self.version.iter_library_revisions()

make_continuation(self, target)

 
Create a continuation of this revision in the target version.

:param target: version to create a continuation into. If it does not
    exist yet, it is created.
:type target: Version


Property Details

ancestor


Parent revision.

- The previous namespace revision, if this revision is regular commit.
- The tag origin, if this revision is a continuation
- ``None`` if this revision is an import.

:type: `Revision` or None

Get Method:
pybaz.Revision._get_ancestor(self)

patchlog


Patchlog associated to this revision.

The `Patchlog` object is created in `__init__`, since log parsing is
deferred that has little overhead and avoid parsing the log for a given
revision several times. The patchlog data is read from the archive.

:type: `Patchlog`
:see: `ArchSourceTree.iter_logs`

Get Method:
pybaz.Revision._get_patchlog(self)

previous


Previous namespace revision.

The previous revision in the same version, or None if this revision is a
``base-0``.

:type: `Revision` or None

Get Method:
pybaz.Revision._get_previous(self)