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

Type Revision

     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

Method Summary
  __init__(self, name)
Create a Revision object from its name.
  apply(self, tree, reverse)
Replay this revision on this tree.
  as_revision(self)
Deprecated Returns this revision.
  cache(self, cache)
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)
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)
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(self)
Deprecated.
  get_patchlevel(self)
Deprecated.
  get_version(self)
Deprecated.
    Inherited from CategoryItem
  get_category(self)
Deprecated.
    Inherited from ArchiveItem
  get_archive(self)
Deprecated.
  get_fullname(self)
Deprecated Fully qualified name of this namespace object.
  get_nonarch(self)
Deprecated.
    Inherited from NamespaceObject
  __eq__(self, x)
Compare types and fully-qualified names.
  __ne__(self, x)
Compare types and fully-qualified names.
  __repr__(self)
Fully-qualified name in angle brackets.
  __str__(self)
Fully-qualified name.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name...
  __getattribute__(...)
x.__getattribute__('name') <==> x.name...
  __hash__(x)
x.__hash__() <==> hash(x)...
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T...
  __reduce__(...)
helper for pickle...
  __reduce_ex__(...)
helper for pickle...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value...

Property Summary
  ancestor: Parent revision.
  patchlog: Patchlog associated to this revision.
  previous: Previous namespace revision.
    Inherited from VersionItem
  branch: Branch which contains this namespace object.
  patchlevel: Patch-level part of this object's name.
  version: Version which contains this revision.
    Inherited from CategoryItem
  category: Category which contains this object.
    Inherited from ArchiveItem
  archive: Archive which contains this namespace object.
  fullname: Fully qualfied name of this namespace object.
  nonarch: Non-arch part of this namespace name.

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:
pybaz.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:
pybaz.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

uncache(self)

Remove the cached tree of this revision from its archive.

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

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`

previous

Previous namespace revision.

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

:type: `Revision` or None

Generated by Epydoc 2.1 on Thu Feb 2 14:21:53 2006 http://epydoc.sf.net