summaryrefslogtreecommitdiff
path: root/lib/git/objects/util.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-11-18 23:11:32 +0100
committerSebastian Thiel <byronimo@gmail.com>2010-11-18 23:11:32 +0100
commitf1545bd9cd6953c5b39c488bf7fe179676060499 (patch)
tree8bd4b8829768fe0195d41a3aa067aa1ac7435605 /lib/git/objects/util.py
parenta1d1d2cb421f16bd277d7c4ce88398ff0f5afb29 (diff)
parent7cf2d5fcf0a3db793678dd6ba9fc1c24d4eeb36a (diff)
downloadgitpython-f1545bd9cd6953c5b39c488bf7fe179676060499.tar.gz
Merge branch 'submodule'
Diffstat (limited to 'lib/git/objects/util.py')
-rw-r--r--lib/git/objects/util.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/git/objects/util.py b/lib/git/objects/util.py
index 21833080..81544e26 100644
--- a/lib/git/objects/util.py
+++ b/lib/git/objects/util.py
@@ -4,6 +4,8 @@
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
"""Module for general utility functions"""
+from git.util import IterableList
+
import re
from collections import deque as Deque
import platform
@@ -273,6 +275,12 @@ class Traversable(object):
"""
raise NotImplementedError("To be implemented in subclass")
+ def list_traverse(self, *args, **kwargs):
+ """:return: IterableList with the results of the traversal as produced by
+ traverse()"""
+ out = IterableList(self._id_attribute_)
+ out.extend(self.traverse(*args, **kwargs))
+ return out
def traverse( self, predicate = lambda i,d: True,
prune = lambda i,d: False, depth = -1, branch_first=True,
@@ -335,7 +343,7 @@ class Traversable(object):
if prune( rval, d ):
continue
- skipStartItem = ignore_self and ( item == self )
+ skipStartItem = ignore_self and ( item is self )
if not skipStartItem and predicate( rval, d ):
yield rval