convert/svn: update svn working copy only when necessary
authorPatrick Mezard <pmezard@gmail.com>
Fri, 02 Dec 2011 17:38:07 +0100
changeset 15605 2ad5b8937d0d
parent 15603 36d7a0c7505f
child 15606 2ad4e9b44d8b
convert/svn: update svn working copy only when necessary I have not tried to produce the bug but here is idea: f85c0034a062 stopped passing the modified files list to commit. This makes commit more fragile since we better not touch unrelated files by mistake. But putcommit() still applies file changes before exiting upon ignored revisions. So in theory, we could apply changes from a skipped branch then commit them as part of another revision. This patch makes the sink apply the changes after possibly skipping the revision. The real fix would be to use svn commit --targets option to pass the file names in an argument file. Unfortunately, it seems to be bugged in svn 1.7.1: http://svn.haxx.se/dev/archive-2011-11/0211.shtml
hgext/convert/subversion.py
--- a/hgext/convert/subversion.py	Thu Dec 01 15:57:10 2011 -0600
+++ b/hgext/convert/subversion.py	Fri Dec 02 17:38:07 2011 +0100
@@ -1116,6 +1116,12 @@
         return u"svn:%s@%s" % (self.uuid, rev)
 
     def putcommit(self, files, copies, parents, commit, source, revmap):
+        for parent in parents:
+            try:
+                return self.revid(self.childmap[parent])
+            except KeyError:
+                pass
+
         # Apply changes to working copy
         for f, v in files:
             try:
@@ -1128,11 +1134,6 @@
                     self.copies.append([copies[f], f])
         files = [f[0] for f in files]
 
-        for parent in parents:
-            try:
-                return self.revid(self.childmap[parent])
-            except KeyError:
-                pass
         entries = set(self.delete)
         files = frozenset(files)
         entries.update(self.add_dirs(files.difference(entries)))