# HG changeset patch # User Patrick Mezard # Date 2011-12-02 16:38:07 # Node ID 2ad5b8937d0d648d2cfeb0998ed12e2ce8c2e6d9 # Parent 36d7a0c7505f7b526303bb140f7bc106f7df457e 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 diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py --- a/hgext/convert/subversion.py +++ b/hgext/convert/subversion.py @@ -1116,6 +1116,12 @@ class svn_sink(converter_sink, commandli 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 @@ class svn_sink(converter_sink, commandli 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)))