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

Type WorkingTree

object --+                        
         |                        
basestring --+                    
             |                    
           str --+                
                 |                
          PathName --+            
                     |            
               DirName --+        
                         |        
                SourceTree --+    
                             |    
                ArchSourceTree --+
                                 |
                                WorkingTree


Working source tree, Arch source tree which can be modified.

Method Summary
  __init__(self, root)
Create WorkingTree object with the given root path.
  add_log_version(self, version)
Add a patch log version to the project tree.
  add_pristine(self, revision)
Ensure that the project tree has a particular pristine revision.
  add_tag(self, file)
  changes(self, revision, output)
Uncommited changes in this tree.
  commit(self, log, strict, seal, fix, out_of_date_ok, file_list, version, just_commit)
Archive a changeset-based revision.
  del_file(self, file)
  del_tag(self, file)
  delete(self, file)
  find_pristine(self, revision)
Path to a pristine tree for the given revision.
  has_changes(self)
Are there uncommited changes is this source tree?...
  import_(self, log)
Archive a full-source base-0 revision.
  iter_commit(self, log, strict, seal, fix, out_of_date_ok, file_list, version, just_commit, stderr_too)
Archive a changeset-based revision, returning an iterator.
  iter_pristines(self)
Pristines present in that source tree.
  iter_star_merge(self, from_, reference, forward, diff3)
Merge mutually merged branches.
  log_for_merge(self)
Standard arch log of newly merged patches.
  log_message(self, create)
Default log-message object used by import and commit.
  move_file(self, src, dest)
  move_tag(self, src, dest)
  redo(self, patch, keep, quiet)
Redo changes in a project tree.
  remove_log_version(self, version)
Remove a patch log version from the project tree.
  replay(self)
Replay changesets into this working tree.
  resolved(self, all)
  set_tagging_method(self, method)
  set_tree_version(self, version)
  star_merge(self, from_, reference, forward, diff3)
Merge mutually merged branches.
  sync_tree(self, revision)
Adds the patchlogs in the given revision to the current tree.
  undo(self, revision, output, quiet, throw_away)
Undo and save changes in a project tree.
  update(self)
Apply delta of new revisions in the archive.
    Inherited from ArchSourceTree
  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, precious, backups, junk, unrecognized, trees, directories, files, both, names, limit)
Tree inventory.
  iter_inventory_ids(self, source, precious, backups, junk, unrecognized, trees, directories, files, both, limit)
Tree inventory with file ids.
  iter_log_versions(self, limit, reverse)
Iterate over versions this tree has a log-version for.
  iter_logs(self, version, reverse)
Iterate over patchlogs present in this tree.
    Inherited from SourceTree
  __new__(cls, root)
Create a source tree object for the given root path. (Static method)
    Inherited from PathName
  __div__(self, path)
  __repr__(self)
  abspath(self)
  basename(self)
  dirname(self)
  realpath(self)
  splitname(self)
    Inherited from str
  __add__(x, y)
x.__add__(y) <==> x+y...
  __contains__(x, y)
x.__contains__(y) <==> y in x...
  __eq__(x, y)
x.__eq__(y) <==> x==y...
  __ge__(x, y)
x.__ge__(y) <==> x>=y...
  __getattribute__(...)
x.__getattribute__('name') <==> x.name...
  __getitem__(x, y)
x.__getitem__(y) <==> x[y]...
  __getnewargs__(...)
  __getslice__(x, i, j)
Use of negative indices is not supported.
  __gt__(x, y)
x.__gt__(y) <==> x>y...
  __hash__(x)
x.__hash__() <==> hash(x)...
  __le__(x, y)
x.__le__(y) <==> x<=y...
  __len__(x)
x.__len__() <==> len(x)...
  __lt__(x, y)
x.__lt__(y) <==> x<y...
  __mod__(x, y)
x.__mod__(y) <==> x%y...
  __mul__(x, n)
x.__mul__(n) <==> x*n...
  __ne__(x, y)
x.__ne__(y) <==> x!=y...
  __rmod__(x, y)
x.__rmod__(y) <==> y%x...
  __rmul__(x, n)
x.__rmul__(n) <==> n*x...
  __str__(x)
x.__str__() <==> str(x)...
  capitalize(S)
Return a copy of the string S with only its first character capitalized.
  center(S, width, fillchar)
Return S centered in a string of length width.
  count(S, sub, start, end)
Return the number of occurrences of substring sub in string S[start:end].
  decode(S, encoding, errors)
Decodes S using the codec registered for encoding.
  encode(S, encoding, errors)
Encodes S using the codec registered for encoding.
  endswith(S, suffix, start, end)
Return True if S ends with the specified suffix, False otherwise.
  expandtabs(S, tabsize)
Return a copy of S where all tab characters are expanded using spaces.
  find(S, sub, start, end)
Return the lowest index in S where substring sub is found, such that sub is contained within s[start,end].
  index(S, sub, start, end)
Like S.find() but raise ValueError when the substring is not found.
  isalnum(S)
Return True if all characters in S are alphanumeric and there is at least one character in S, False otherwise.
  isalpha(S)
Return True if all characters in S are alphabetic and there is at least one character in S, False otherwise.
  isdigit(S)
Return True if all characters in S are digits and there is at least one character in S, False otherwise.
  islower(S)
Return True if all cased characters in S are lowercase and there is at least one cased character in S, False otherwise.
  isspace(S)
Return True if all characters in S are whitespace and there is at least one character in S, False otherwise.
  istitle(S)
Return True if S is a titlecased string and there is at least one character in S, i.e.
  isupper(S)
Return True if all cased characters in S are uppercase and there is at least one cased character in S, False otherwise.
  join(S, sequence)
Return a string which is the concatenation of the strings in the sequence.
  ljust(S, width, fillchar)
Return S left justified in a string of length width.
  lower(S)
Return a copy of the string S converted to lowercase.
  lstrip(S, chars)
Return a copy of the string S with leading whitespace removed.
  replace(...)
S.replace (old, new[, count]) -> string Return a copy of string S with all occurrences of substring old replaced by new.
  rfind(S, sub, start, end)
Return the highest index in S where substring sub is found, such that sub is contained within s[start,end].
  rindex(S, sub, start, end)
Like S.rfind() but raise ValueError when the substring is not found.
  rjust(S, width, fillchar)
Return S right justified in a string of length width.
  rsplit(S, sep, maxsplit)
Return a list of the words in the string S, using sep as the delimiter string, starting at the end of the string and working to the front.
  rstrip(S, chars)
Return a copy of the string S with trailing whitespace removed.
  split(S, sep, maxsplit)
Return a list of the words in the string S, using sep as the delimiter string.
  splitlines(S, keepends)
Return a list of the lines in S, breaking at line boundaries.
  startswith(S, prefix, start, end)
Return True if S starts with the specified prefix, False otherwise.
  strip(S, chars)
Return a copy of the string S with leading and trailing whitespace removed.
  swapcase(S)
Return a copy of the string S with uppercase characters converted to lowercase and vice versa.
  title(S)
Return a titlecased version of S, i.e.
  translate(S, table, deletechars)
Return a copy of the string S, where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table, which must be a string of length 256.
  upper(S)
Return a copy of the string S converted to uppercase.
  zfill(S, width)
Pad a numeric string S with zeros on the left, to fill a field of the specified width.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name...
  __reduce__(...)
helper for pickle...
  __reduce_ex__(...)
helper for pickle...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value...

Property Summary
  tagging_method
  tree_version
    Inherited from ArchSourceTree
  tree_revision

Instance Method Details

__init__(self, root)
(Constructor)

Create WorkingTree object with the given root path.

Root must be a directory containing a valid Arch source tree
outside of the revision library.
Overrides:
__builtin__.object.__init__

add_log_version(self, version)

Add a patch log version to the project tree.

add_pristine(self, revision)

Ensure that the project tree has a particular pristine revision.

:param revision: revision to add a pristine for.
:type revision: `Revision`

changes(self, revision=None, output=None)

Uncommited changes in this tree.

:param revision: produce the changeset between this revision
    and the tree. If ``revision`` is ``None``, use the
    tree-revision.
:type revision: `Revision`, None
:param output: absolute path of the changeset to produce.
:type output: string
:return: changeset between ``revision`` and the tree.
:rtype: Changeset
:raise errors.TreeVersionError: no valid default version set.
:raise IOError: unable to read the ++default-version file.

commit(self, log=None, strict=False, seal=False, fix=False, out_of_date_ok=False, file_list=None, version=None, just_commit=False)

Archive a changeset-based revision.

:keyword version: version in which to commit the revision.
    Defaults to the `tree_version`.
:type version: `Version`, str
:keyword log: Log message for this revision. Defaults to the log
    message file of the tree-version (the file created by
    ``tla make-log``.
:type log: `LogMessage`
:param strict: perform a strict tree-lint before commiting.
:type strict: bool
:param seal: create a ``version-0`` revision.
:type seal: bool
:param fix: create a ``versionfix`` revision.
:type fix: bool
:param out_of_date_ok: commit even if the tree is out of
    date.
:type out_of_date_ok: bool
:param file_list: Only commit changes to those files,
    specified relative to the tree-root.
:type file_list: iterable of str, with at least one item.
:param just_commit: only create new revision, do not add ancillary data
    like cachedrevs or ancestry files.
:type just_commit: bool

The --summary and --log-message options to tla are mere CLI
convenience features and are not directly supported.

:see: `WorkingTree.iter_commit`

find_pristine(self, revision)

Path to a pristine tree for the given revision.

:param revision: find a pristine for that revision.
:type revision: `Revision`
:rtype: `ArchSourceTree`
:raise errors.NoPristineFoundError: no pristine tree was found
    for the given revision.

has_changes(self)

Are there uncommited changes is this source tree?

:rtype: bool

import_(self, log=None)

Archive a full-source base-0 revision.

If log is specified, it must be a LogMessage object or a file
name as a string. If omitted, the default log message file of
the tree is used.

The --summary, --log-message and --setup options to tla are
mere CLI convenience features and are not directly supported.

iter_commit(self, log=None, strict=False, seal=False, fix=False, out_of_date_ok=False, file_list=None, version=None, just_commit=False, stderr_too=False)

Archive a changeset-based revision, returning an iterator.


:keyword version: version in which to commit the revision.
    Defaults to the `tree_version`.
:type version: `Version`, str
:keyword log: Log message for this revision. Defaults to the log
    message file of the tree-version (the file created by
    ``tla make-log``.
:type log: `LogMessage`
:keyword strict: perform a strict tree-lint before commiting.
:type strict: bool
:keyword seal: create a ``version-0`` revision.
:type seal: bool
:keyword fix: create a ``versionfix`` revision.
:type fix: bool
:keyword out_of_date_ok: commit even if the tree is out of
    date.
:type out_of_date_ok: bool
:keyword file_list: Only commit changes to those files,
    specified relative to the tree-root.
:type file_list: iterable of str, with at least one item.
:param just_commit: only create new revision, do not add ancillary data
    like cachedrevs or ancestry files.
:type just_commit: bool
:param stderr_too: iterate over stderr output as well as stdout.
:type stderr_too: bool
:rtype: iterator of `TreeChange`, `Chatter` or str

:warning: ``stderr_too=True`` is only supported with the
PyArchSpawningStrategy. Using it will cause a ArgumentError with the
TwistedSpawningStrategy. That will be fixed when the process handling
subsystem is replaced by Gnarly.

The --summary and --log-message options to tla are mere CLI
convenience features and are not directly supported.

:see: `WorkingTree.commit`

iter_pristines(self)

Pristines present in that source tree.

:return: Revisions which have pristine trees in that source tree.
:rtype: iterable of `Revision`

iter_star_merge(self, from_=None, reference=None, forward=False, diff3=False)

Merge mutually merged branches.

:param `from_`: branch to merge changes from, ``None`` means the
    ``tree-version``.
:type `from_`: None, `Version`, `Revision`, or str
:param reference: reference version for the merge, ``None``
    means the ``tree-version``.
:type reference: None, `Version` or str
:param forward: ignore already applied patch hunks.
:type forward: bool
:param diff3: produce inline conflict markers instead of
    ``.rej`` files.
:type diff3: bool
:raise errors.NamespaceError: ``from_`` or ``reference`` is
    not a valid version or revision name.
:rtype: `ChangesetApplication`

log_for_merge(self)

Standard arch log of newly merged patches.

:rtype: str

log_message(self, create=True)

Default log-message object used by import and commit.

If `create` is False, and the standard log file does not already
exists, return None. If `create` is True, use ``tla make-log`` if
needed.

redo(self, patch=None, keep=False, quiet=False)

Redo changes in a project tree.

Apply patch to the project tree and delete patch.

If patch is provided, it must be a Changeset object. Else, the highest
numbered ,,undo-N directory in the project tree root is used.

If keep is true, the patch directory is not deleted.

remove_log_version(self, version)

Remove a patch log version from the project tree.

replay(self)

Replay changesets into this working tree.

star_merge(self, from_=None, reference=None, forward=False, diff3=False)

Merge mutually merged branches.

:bug: if the merge causes a conflict, a RuntimeError is
    raised. You should not rely on this behaviour as it is
    likely to change in the future. If you want to support
    conflicting merges, use `iter_star_merge` instead.

:param `from_`: branch to merge changes from, ``None`` means the
    ``tree-version``.
:type `from_`: None, `Version`, `Revision`, or str
:param reference: reference version for the merge, ``None``
    means the ``tree-version``.
:type reference: None, `Version` or str
:param forward: ignore already applied patch hunks.
:type forward: bool
:param diff3: produce inline conflict markers instead of
    ``.rej`` files.
:type diff3: bool
:raise errors.NamespaceError: ``from_`` or ``reference`` is
    not a valid version or revision name.

sync_tree(self, revision)

Adds the patchlogs in the given revision to the current tree.

Create a temporary source tree for ``revision``, then add all the
patchlogs present in that tree to the current tree. No content
is touched besides the patchlogs.

:param revision: revision to synchronize with.
:type revision: `Version`, `Revision` or str
:raise errors.NamespaceError: ``revision`` is not a valid
    version or revision name.

undo(self, revision=None, output=None, quiet=False, throw_away=False)

Undo and save changes in a project tree.

Remove local changes since revision and optionally save them
as a changeset.

:keyword revision: revision to revert to. Default to the last
    revision of the tree-version for which a patchlog is present.
:type revision: `Revision`, str
:keyword output: name of the output changeset directory. Must
    not already exist. Default to an automatic ,,undo-N name
    in the working tree.
:type output: str
:keyword quiet: OBSOLETE. Incremental output is always discarded.
:type quiet: bool
:keyword throw_away: discard the output changeset and return
    ``None``. Must not be used at the same time as ``output``.
:type throw_away: bool
:return: changeset restoring the undone changes,
    or None if ``throw_away``.
:rtype: `Changeset`, None

update(self)

Apply delta of new revisions in the archive.

Apply delta(A,B) on this working tree, where A and B are both
revisions of the tree version, A is the latest whose patchlog
is present in the tree and B is the latest present in the
archive.

Property Details

tagging_method

Get Method:
get_tagging_method(self)
Set Method:
set_tagging_method(self, method)

tree_version

Get Method:
get_tree_version(self)
Set Method:
set_tree_version(self, version)

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