convert: compare tags from all heads instead of just one
Previously, the hg sink for puttags would just use one head for getting the old
tags which would sometimes lead to tags disappearing. Now, we iterate over all
heads and merge the results.
--- a/hgext/convert/hg.py Tue Jan 21 11:35:17 2014 -0600
+++ b/hgext/convert/hg.py Wed Jan 22 17:38:05 2014 -0600
@@ -201,10 +201,13 @@
parentctx = None
tagparent = nullid
- try:
- oldlines = sorted(parentctx['.hgtags'].data().splitlines(True))
- except Exception:
- oldlines = []
+ oldlines = set()
+ for branch, heads in self.repo.branchmap().iteritems():
+ for h in heads:
+ if '.hgtags' in self.repo[h]:
+ oldlines.update(
+ set(self.repo[h]['.hgtags'].data().splitlines(True)))
+ oldlines = sorted(list(oldlines))
newlines = sorted([("%s %s\n" % (tags[tag], tag)) for tag in tags])
if newlines == oldlines: