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

Class ArchSourceTree

source code

object --+                    
         |                    
basestring --+                
             |                
           str --+            
                 |            
 pathname.PathName --+        
                     |        
      pathname.DirName --+    
                         |    
                SourceTree --+
                             |
                            ArchSourceTree
Known Subclasses:
LibraryTree, WorkingTree

Abstract base class for Arch source trees.



Instance Methods
 
check_is_tree_root(self)
 
file_find(self, name, revision)
Find a pristine copy of a file for a given revision.
 
get_tag(self, name)
Read a file id set by an explicit id tag or tagline.
 
get_tagging_method(self)
 
get_tree(self)
 
get_tree_version(self)
Default version of the tree, also called tree-version.
 
inventory(self, *args, **kw)
Deprecated.
 
iter_inventory(self, source=False, precious=False, backups=False, junk=False, unrecognized=False, trees=False, directories=False, files=False, both=False, names=False, limit=None)
Tree inventory.
 
iter_inventory_ids(self, source=False, precious=False, backups=False, junk=False, unrecognized=False, trees=False, directories=False, files=False, both=False, limit=None)
Tree inventory with file ids.
 
iter_log_versions(self, limit=None, reverse=False)
Iterate over versions this tree has a log-version for.
 
iter_logs(self, version=None, reverse=False)
Iterate over patchlogs present in this tree.

Inherited from pathname.PathName: __div__, __repr__, abspath, basename, dirname, realpath, splitname

Inherited from str: __add__, __contains__, __eq__, __ge__, __getattribute__, __getitem__, __getnewargs__, __getslice__, __gt__, __hash__, __le__, __len__, __lt__, __mod__, __mul__, __ne__, __rmod__, __rmul__, __str__, capitalize, center, count, decode, encode, endswith, expandtabs, find, index, isalnum, isalpha, isdigit, islower, isspace, istitle, isupper, join, ljust, lower, lstrip, partition, replace, rfind, rindex, rjust, rpartition, rsplit, rstrip, split, splitlines, startswith, strip, swapcase, title, translate, upper, zfill

Inherited from object: __delattr__, __init__, __reduce__, __reduce_ex__, __setattr__

Static Methods

Inherited from SourceTree: __new__

Properties
  tagging_method
  tree_revision
Revision of the last patchlog for the tree-version.
  tree_version
Default version of the tree, also called tree-version.

Inherited from object: __class__

Method Details

file_find(self, name, revision)

 
Find a pristine copy of a file for a given revision.

Will create the requested revision in the library or in the
current tree pristines if needed.

:param name: name of the file.
:type name: str
:param revision: revision to look for the file into.
:type revision: `Revision`
:return: absolute path name of a pristine copy of the file.
:rtype: `pathname.PathName`
:raise errors.MissingFileError: file is not source or is not
    present in the specified revision.

get_tag(self, name)

 
Read a file id set by an explicit id tag or tagline.

FIXME: update docstring when support for pybaz<1.3 is dropped, as this
release fixed "baz id" to report name-based ids correctly.

:param name: name of a source file relative to the tree-root.
:type name: str
:return: file id if the file has an explicit id or a tagline.
:rtype: str

get_tree_version(self)

 
Default version of the tree, also called tree-version.

:raise errors.TreeVersionError: no valid default version set.
:raise IOError: unable to read the ++default-version file.

inventory(self, *args, **kw)

 
Deprecated.

Inventory of the source tree as a list.

:see: `iter_inventory`

iter_inventory(self, source=False, precious=False, backups=False, junk=False, unrecognized=False, trees=False, directories=False, files=False, both=False, names=False, limit=None)

 
Tree inventory.

The kind of files looked for is specified by setting to
``True`` exactly one of the following keyword arguments:

    ``source``, ``precious``, ``backups``, ``junk``,
    ``unrecognized``, ``trees``.

If the ``trees`` argument is not set, whether files, directory
or both should be listed is specified by setting to ``True``
exactly one of the following keyword arguments:

    ``directories``, ``files``, ``both``.

:keyword source: list source files only.
:keyword precious: list precious files only.
:keyword backups: list backup files only.
:keyword junk: list junk files only.
:keyword unrecognized: list unrecognized files only.
:keyword trees: list nested trees only. If this is true, the
    iterator wil only yield `ArchSourceTree` objects.

:keyword directories: list directories only,
    yield only `FileName` objects.
:keyword files: list files only, yield only `DirName` objects.
:keyword both: list both files and directories,
    yield both FileName and `DirName` objects.

:keyword name: do inventory as if the id-tagging-method was
    set to ``names``. That is useful to ignore
    ``untagged-source`` classification.

:keyword limit: restrict the inventory to this directory. Must
    be the name of a directory relative to the tree root.

:rtype: iterable of `FileName`, `DirName`, `ArchSourceTree`
    according to the arguments.

iter_inventory_ids(self, source=False, precious=False, backups=False, junk=False, unrecognized=False, trees=False, directories=False, files=False, both=False, limit=None)

 
Tree inventory with file ids.

:see: `ArchSourceTree.iter_inventory`

:rtype: iterable of tuples ``(id, item)``, where ``item`` is
    `FileName`, `DirName`, `ArchSourceTree` according to the
    arguments and ``id`` is the associated inventory id.

iter_log_versions(self, limit=None, reverse=False)

 
Iterate over versions this tree has a log-version for.

:param limit: only iterate log-versions in this namespace.
:type limit: `Archive`, `Category`, `Branch`, `Version`
:param reverse: yield log-versions in reverse order.
:type reverse: bool

iter_logs(self, version=None, reverse=False)

 
Iterate over patchlogs present in this tree.

:param version: list patchlogs from this version. Defaults to
    the tree-version.
:type version: `Version`
:param reverse: iterate more recent logs first.
:type reverse: bool
:return: patchlogs from ``version``.
:rtype: iterator of `Patchlog`.
:raise errors.TreeVersionError: no valid default version set.
:raise IOError: unable to read the ++default-version file.


Property Details

tagging_method

Get Method:
pybaz.ArchSourceTree.get_tagging_method(self)

tree_revision

Revision of the last patchlog for the tree-version.

:raise errors.TreeVersionError: no valid default version set.
:raise IOError: unable to read the ++default-version file.

Get Method:
pybaz.ArchSourceTree._get_tree_revision(self) - Revision of the last patchlog for the tree-version.

tree_version

Default version of the tree, also called tree-version.

:raise errors.TreeVersionError: no valid default version set.
:raise IOError: unable to read the ++default-version file.

Get Method:
pybaz.ArchSourceTree.get_tree_version(self) - Default version of the tree, also called tree-version.