Ignore .git as well as .svn directories when assembling forests.
This commit is contained in:
parent
b31c324728
commit
4a5ecd48b5
1 changed files with 2 additions and 2 deletions
|
@ -66,7 +66,7 @@ def parse_attribute(str):
|
|||
class Forest:
|
||||
"Return an iterable directory forest object."
|
||||
def __init__(self, dirpath, exclude=None):
|
||||
"Get the names of all files under dirpath, ignoring .svn directories."
|
||||
"Get the names of all files under dirpath, ignoring .svn and .git directories."
|
||||
self.forest = []
|
||||
self.dirpath = dirpath
|
||||
for dir in dirpath:
|
||||
|
@ -77,7 +77,7 @@ class Forest:
|
|||
None)
|
||||
self.forest.append(subtree)
|
||||
for i in range(len(self.forest)):
|
||||
self.forest[i] = filter(lambda x: ".svn" not in x, self.forest[i])
|
||||
self.forest[i] = filter(lambda x: ".svn" not in x and ".git" not in x, self.forest[i])
|
||||
self.forest[i] = filter(lambda x: not os.path.isdir(x), self.forest[i])
|
||||
if exclude:
|
||||
self.forest[i] = filter(lambda x: not re.search(exclude, x), self.forest[i])
|
||||
|
|
Loading…
Add table
Reference in a new issue