convert: remove incorrect and unused handling of removed svn directories
authorMads Kiilerich <madski@unity3d.com>
Tue, 26 Aug 2014 22:03:32 +0200
changeset 22297 a74d05878a8d
parent 22296 650b5b6e75ed
child 22298 4ba35d4298a0
convert: remove incorrect and unused handling of removed svn directories Since it was introduced in f0c58fd4b798, tidy_dirs has been comparing the result of os.listdir with a string - which never can be true. Convert apparently works anyway and there is no test coverage of it. It also seems like it could make a bigger difference on older svn versions but is less relevant with more recent versions. Instead of trying to fix the code, we take the low risk option and remove it.
hgext/convert/subversion.py
--- a/hgext/convert/subversion.py	Tue Aug 26 22:03:32 2014 +0200
+++ b/hgext/convert/subversion.py	Tue Aug 26 22:03:32 2014 +0200
@@ -1211,16 +1211,6 @@
             self.xargs(files, 'add', quiet=True)
         return files
 
-    def tidy_dirs(self, names):
-        deleted = []
-        for d in sorted(self.dirs_of(names), reverse=True):
-            wd = self.wjoin(d)
-            if os.listdir(wd) == '.svn':
-                self.run0('delete', d)
-                self.manifest.remove(d)
-                deleted.append(d)
-        return deleted
-
     def addchild(self, parent, child):
         self.childmap[parent] = child
 
@@ -1258,7 +1248,6 @@
                 self.manifest.remove(f)
             self.delete = []
         entries.update(self.add_files(files.difference(entries)))
-        entries.update(self.tidy_dirs(entries))
         if self.delexec:
             self.xargs(self.delexec, 'propdel', 'svn:executable')
             self.delexec = []