summaryrefslogtreecommitdiff
path: root/lib/git/objects/tree.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-18 14:25:14 +0200
committerSebastian Thiel <byronimo@gmail.com>2009-10-18 14:25:14 +0200
commit225999e9442c746333a8baa17a6dbf7341c135ca (patch)
tree82e4bdf8a59fae869bae41aa6b9b048fee2d3e09 /lib/git/objects/tree.py
parent919164df96d9f956c8be712f33a9a037b097745b (diff)
parent9acc7806d6bdb306a929c460437d3d03e5e48dcd (diff)
downloadgitpython-225999e9442c746333a8baa17a6dbf7341c135ca.tar.gz
Merge branch 'diffing' into improvements
* diffing: DiffIndex implemented including test diff: implemented raw diff parsing which appears to be able to handle possible input types, DiffIndex still requires implementation though resolved cyclic inclusion issue by moving the Diffable interface into the diff module, which probably is the right thing to do anyway repo: fixed untracked files function which used git-commit before, it can open vim to get a message though which makes the program appear to freeze - using git-status now implemented diff tests, but will have to move the diff module as it needs to create objects, whose import would create a dependency cycle Removed a few diff-related test cases that fail now as the respective method is missing - these tests have to be redone in test-diff module accordingly added Diffable interface to objects.base, its used by Commit and Tree objects. Fixed object bug that would cause object ids not to be resolved to sha's as this was assumed - now there is a test for it as well
Diffstat (limited to 'lib/git/objects/tree.py')
-rw-r--r--lib/git/objects/tree.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/git/objects/tree.py b/lib/git/objects/tree.py
index abfa9622..c35c075e 100644
--- a/lib/git/objects/tree.py
+++ b/lib/git/objects/tree.py
@@ -8,6 +8,7 @@ import os
import blob
import base
import binascii
+import git.diff as diff
def sha_to_hex(sha):
"""Takes a string and returns the hex of the sha within"""
@@ -15,7 +16,7 @@ def sha_to_hex(sha):
assert len(hexsha) == 40, "Incorrect length of sha1 string: %d" % hexsha
return hexsha
-class Tree(base.IndexObject):
+class Tree(base.IndexObject, diff.Diffable):
"""
Tress represent a ordered list of Blobs and other Trees. Hence it can be
accessed like a list.
@@ -169,6 +170,7 @@ class Tree(base.IndexObject):
def traverse(self, max_depth=-1, predicate = lambda i: True):
"""
Returns
+
Iterator to traverse the tree recursively up to the given level.
The iterator returns Blob and Tree objects