summaryrefslogtreecommitdiff
path: root/lib/git/objects/tree.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-07-01 17:58:19 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-07-01 17:58:19 +0200
commitfd96cceded27d1372bdc1a851448d2d8613f60f3 (patch)
tree5b53f288a3379e260f46a65d08691fceec4a0ca3 /lib/git/objects/tree.py
parent6917ae4ce9eaa0f5ea91592988c1ea830626ac3a (diff)
parentc3bd05b426a0e3dec8224244c3c9c0431d1ff130 (diff)
downloadgitpython-fd96cceded27d1372bdc1a851448d2d8613f60f3.tar.gz
Merge branch 'docs'
Diffstat (limited to 'lib/git/objects/tree.py')
-rw-r--r--lib/git/objects/tree.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/git/objects/tree.py b/lib/git/objects/tree.py
index 056d3da9..d6e16a31 100644
--- a/lib/git/objects/tree.py
+++ b/lib/git/objects/tree.py
@@ -3,7 +3,7 @@
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
-import utils
+import util
from base import IndexObject
from blob import Blob
@@ -23,8 +23,8 @@ from gitdb.util import (
__all__ = ("TreeModifier", "Tree")
class TreeModifier(object):
- """A utility class providing methods to alter the underlying cache in a list-like
- fashion.
+ """A utility class providing methods to alter the underlying cache in a list-like fashion.
+
Once all adjustments are complete, the _cache, which really is a refernce to
the cache of a tree, will be sorted. Assuring it will be in a serializable state"""
__slots__ = '_cache'
@@ -57,6 +57,7 @@ class TreeModifier(object):
exists, nothing will be done, but a ValueError will be raised if the
sha and mode of the existing item do not match the one you add, unless
force is True
+
:param sha: The 20 or 40 byte sha of the item to add
:param mode: int representing the stat compatible mode of the item
:param force: If True, an item with your name and information will overwrite
@@ -100,7 +101,7 @@ class TreeModifier(object):
#} END mutators
-class Tree(IndexObject, diff.Diffable, utils.Traversable, utils.Serializable):
+class Tree(IndexObject, diff.Diffable, util.Traversable, util.Serializable):
"""Tree objects represent an ordered list of Blobs and other Trees.
``Tree as a list``::
@@ -203,16 +204,17 @@ class Tree(IndexObject, diff.Diffable, utils.Traversable, utils.Serializable):
@property
def cache(self):
- """:return: An object allowing to modify the internal cache. This can be used
- to change the tree's contents. When done, make sure you call ``set_done``
- on the tree modifier, or serialization behaviour will be incorrect.
- See the ``TreeModifier`` for more information on how to alter the cache"""
+ """
+ :return: An object allowing to modify the internal cache. This can be used
+ to change the tree's contents. When done, make sure you call ``set_done``
+ on the tree modifier, or serialization behaviour will be incorrect.
+ See the ``TreeModifier`` for more information on how to alter the cache"""
return TreeModifier(self._cache)
def traverse( self, predicate = lambda i,d: True,
prune = lambda i,d: False, depth = -1, branch_first=True,
visit_once = False, ignore_self=1 ):
- """For documentation, see utils.Traversable.traverse
+ """For documentation, see util.Traversable.traverse
Trees are set to visit_once = False to gain more performance in the traversal"""
return super(Tree, self).traverse(predicate, prune, depth, branch_first, visit_once, ignore_self)