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)

Changeset

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)

ArchSourceTree

find_pristine(self, revision)
Path to a pristine tree for the given revision.

bool

has_changes(self)
Are there uncommited changes is this source tree?
  import_(self, log)
Archive a full-source base-0 revision.

iterator of TreeChange, Chatter or str

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.

iterable of Revision

iter_pristines(self)
Pristines present in that source tree.

ChangesetApplication

iter_star_merge(self, from_, reference, forward, diff3)
Merge mutually merged branches.

str

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.

Changeset, None

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)

pathname.PathName

file_find(self, name, revision)
Find a pristine copy of a file for a given revision.

str

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.

iterable of FileName, DirName, ArchSourceTree according to the arguments.

iter_inventory(self, source, precious, backups, junk, unrecognized, trees, directories, files, both, names, limit)
Tree inventory.

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

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.

iterator of Patchlog.

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)
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)
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
  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)
Return S right justified in a string of length width.
  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.

Parameters:
revision -

revision to add a pristine for.


           (type=

Revision

)

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

Uncommited changes in this tree.

Parameters:
revision -

produce the changeset between this revision and the tree. If revision is None, use the tree-revision.


           (type=

Revision, None

)
output -

absolute path of the changeset to produce.


           (type=

string

)
Returns:

changeset between revision and the tree.


           (type=

Changeset

)
Raises:
errors.TreeVersionError -

no valid default version set.

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.

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

Parameters:
log
           (type=

LogMessage

)
strict -

perform a strict tree-lint before commiting.


           (type=

bool

)
seal -

create a version-0 revision.


           (type=

bool

)
fix -

create a versionfix revision.


           (type=

bool

)
out_of_date_ok -

commit even if the tree is out of date.


           (type=

bool

)
file_list -

Only commit changes to those files, specified relative to the tree-root.


           (type=

iterable of str, with at least one item.

)
version
           (type=

Version, str

)
just_commit -

only create new revision, do not add ancillary data like cachedrevs or ancestry files.


           (type=

bool

)
Keyword Parameters:
version -

version in which to commit the revision. Defaults to the tree_version.

log -

Log message for this revision. Defaults to the log message file of the tree-version (the file created by tla make-log.

See Also:

WorkingTree.iter_commit

find_pristine(self, revision)

Path to a pristine tree for the given revision.

Parameters:
revision -

find a pristine for that revision.


           (type=

Revision

)
Returns:

ArchSourceTree

Raises:
errors.NoPristineFoundError -

no pristine tree was found for the given revision.

has_changes(self)

Are there uncommited changes is this source tree?

Returns:

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.

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.

Parameters:
log
           (type=

LogMessage

)
strict
           (type=

bool

)
seal
           (type=

bool

)
fix
           (type=

bool

)
out_of_date_ok
           (type=

bool

)
file_list
           (type=

iterable of str, with at least one item.

)
version
           (type=

Version, str

)
just_commit -

only create new revision, do not add ancillary data like cachedrevs or ancestry files.


           (type=

bool

)
stderr_too -

iterate over stderr output as well as stdout.


           (type=

bool

)
Keyword Parameters:
version -

version in which to commit the revision. Defaults to the tree_version.

log -

Log message for this revision. Defaults to the log message file of the tree-version (the file created by tla make-log.

strict -

perform a strict tree-lint before commiting.

seal -

create a version-0 revision.

fix -

create a versionfix revision.

out_of_date_ok -

commit even if the tree is out of date.

file_list -

Only commit changes to those files, specified relative to the tree-root.

Returns:

iterator of TreeChange, Chatter or str

Warning:

stderr_too=True is only supported with the

See Also:

WorkingTree.commit

iter_pristines(self)

Pristines present in that source tree.

Returns:

Revisions which have pristine trees in that source tree.


           (type=

iterable of Revision

)

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

Merge mutually merged branches.

Parameters:
from_ -

branch to merge changes from, None means the tree-version.


           (type=

None, Version, Revision, or str

)
reference -

reference version for the merge, None means the tree-version.


           (type=

None, Version or str

)
forward -

ignore already applied patch hunks.


           (type=

bool

)
diff3 -

produce inline conflict markers instead of .rej files.


           (type=

bool

)
Returns:

ChangesetApplication

Raises:
errors.NamespaceError -

from_ or reference is not a valid version or revision name.

log_for_merge(self)

Standard arch log of newly merged patches.

Returns:

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.

Parameters:
from_ -

branch to merge changes from, None means the tree-version.


           (type=

None, Version, Revision, or str

)
reference -

reference version for the merge, None means the tree-version.


           (type=

None, Version or str

)
forward -

ignore already applied patch hunks.


           (type=

bool

)
diff3 -

produce inline conflict markers instead of .rej files.


           (type=

bool

)
Raises:
errors.NamespaceError -

from_ or reference is not a valid version or revision name.

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.

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.

Parameters:
revision -

revision to synchronize with.


           (type=

Version, Revision or str

)
Raises:
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.

Parameters:
revision
           (type=

Revision, str

)
output
           (type=

str

)
quiet
           (type=

bool

)
throw_away
           (type=

bool

)
Keyword Parameters:
revision -

revision to revert to. Default to the last revision of the tree-version for which a patchlog is present.

output -

name of the output changeset directory. Must not already exist. Default to an automatic ,,undo-N name in the working tree.

quiet -

OBSOLETE. Incremental output is always discarded.

throw_away -

discard the output changeset and return None. Must not be used at the same time as output.

Returns:

changeset restoring the undone changes, or None if throw_away.


           (type=

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 Fri Jul 7 17:05:32 2006 http://epydoc.sf.net