fix cleaning
authorTimo Savola <tsavola@movial.fi>
Tue, 8 Apr 2008 17:31:17 +0000 (20:31 +0300)
committerTimo Savola <tsavola@movial.fi>
Tue, 8 Apr 2008 17:31:17 +0000 (20:31 +0300)
matrix/git.py
matrix/repositories.py

index 73411eb..3457e27 100644 (file)
@@ -180,8 +180,14 @@ def ls_tree(name, treeish, name_only=False, recursive=False):
 
        return call_output(['ls-tree'] + options + [treeish], workdir=name)
 
-def ls_files(name, options):
-       return call_output(['ls-files'] + options, workdir=name)
+def ls_files(name, options, exclude=None):
+       cmd = ['ls-files'] + options
+
+       if exclude:
+               for e in exclude:
+                       cmd.append('--exclude=%s' % e)
+
+       return call_output(cmd, workdir=name)
 
 def archive(name, arch_name, prefix=None, treeish='HEAD'):
        cmd = ['archive', '--format=tar']
index aecb605..8268536 100644 (file)
@@ -91,11 +91,14 @@ class Repository(object):
 
                git.pull(self.path)
 
+       def ls_files(self, options):
+               return git.ls_files(self.path, options, exclude=self.exclude)
+
        def other_files(self):
-               return git.ls_files(self.path, ['-o'])
+               return self.ls_files(['-o'])
 
        def dirty_files(self):
-               return git.ls_files(self.path, ['-m', '-d'])
+               return self.ls_files(['-m', '-d'])
 
        def clean(self):
                print 'Cleaning', self
@@ -105,9 +108,6 @@ class Repository(object):
                paths.reverse()
 
                for path in paths:
-                       if git.contains_database(path):
-                               continue
-
                        if config.debug:
                                print 'Removing', path