summaryrefslogtreecommitdiff
path: root/lib/git/objects/util.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-11-15 18:42:44 +0100
committerSebastian Thiel <byronimo@gmail.com>2010-11-15 18:42:44 +0100
commitf97653aa06cf84bcf160be3786b6fce49ef52961 (patch)
tree03d5469f124ab166137196c16bf39f628c962185 /lib/git/objects/util.py
parent00ce31ad308ff4c7ef874d2fa64374f47980c85c (diff)
downloadgitpython-f97653aa06cf84bcf160be3786b6fce49ef52961.tar.gz
Repo: added submodule query and iteration methods similar to the ones provided for Remotes, including test
Diffstat (limited to 'lib/git/objects/util.py')
-rw-r--r--lib/git/objects/util.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/git/objects/util.py b/lib/git/objects/util.py
index 21833080..9a54e031 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,