Mercurial > hg-stable
comparison hgext/convert/subversion.py @ 15605:2ad5b8937d0d
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
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Fri, 02 Dec 2011 17:38:07 +0100 |
parents | c6be93a4c378 |
children | 742c766c8cea |
comparison
equal
deleted
inserted
replaced
15603:36d7a0c7505f | 15605:2ad5b8937d0d |
---|---|
1114 | 1114 |
1115 def revid(self, rev): | 1115 def revid(self, rev): |
1116 return u"svn:%s@%s" % (self.uuid, rev) | 1116 return u"svn:%s@%s" % (self.uuid, rev) |
1117 | 1117 |
1118 def putcommit(self, files, copies, parents, commit, source, revmap): | 1118 def putcommit(self, files, copies, parents, commit, source, revmap): |
1119 for parent in parents: | |
1120 try: | |
1121 return self.revid(self.childmap[parent]) | |
1122 except KeyError: | |
1123 pass | |
1124 | |
1119 # Apply changes to working copy | 1125 # Apply changes to working copy |
1120 for f, v in files: | 1126 for f, v in files: |
1121 try: | 1127 try: |
1122 data, mode = source.getfile(f, v) | 1128 data, mode = source.getfile(f, v) |
1123 except IOError: | 1129 except IOError: |
1126 self.putfile(f, mode, data) | 1132 self.putfile(f, mode, data) |
1127 if f in copies: | 1133 if f in copies: |
1128 self.copies.append([copies[f], f]) | 1134 self.copies.append([copies[f], f]) |
1129 files = [f[0] for f in files] | 1135 files = [f[0] for f in files] |
1130 | 1136 |
1131 for parent in parents: | |
1132 try: | |
1133 return self.revid(self.childmap[parent]) | |
1134 except KeyError: | |
1135 pass | |
1136 entries = set(self.delete) | 1137 entries = set(self.delete) |
1137 files = frozenset(files) | 1138 files = frozenset(files) |
1138 entries.update(self.add_dirs(files.difference(entries))) | 1139 entries.update(self.add_dirs(files.difference(entries))) |
1139 if self.copies: | 1140 if self.copies: |
1140 for s, d in self.copies: | 1141 for s, d in self.copies: |