Mercurial > hg
comparison hgext/convert/hg.py @ 20376:7a4797910205
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.
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Wed, 22 Jan 2014 17:38:05 -0600 |
parents | e8203629371b |
children | 5842d63cfe56 |
comparison
equal
deleted
inserted
replaced
20375:81cf597dafa9 | 20376:7a4797910205 |
---|---|
199 tagparent = parentctx.node() | 199 tagparent = parentctx.node() |
200 except error.RepoError: | 200 except error.RepoError: |
201 parentctx = None | 201 parentctx = None |
202 tagparent = nullid | 202 tagparent = nullid |
203 | 203 |
204 try: | 204 oldlines = set() |
205 oldlines = sorted(parentctx['.hgtags'].data().splitlines(True)) | 205 for branch, heads in self.repo.branchmap().iteritems(): |
206 except Exception: | 206 for h in heads: |
207 oldlines = [] | 207 if '.hgtags' in self.repo[h]: |
208 oldlines.update( | |
209 set(self.repo[h]['.hgtags'].data().splitlines(True))) | |
210 oldlines = sorted(list(oldlines)) | |
208 | 211 |
209 newlines = sorted([("%s %s\n" % (tags[tag], tag)) for tag in tags]) | 212 newlines = sorted([("%s %s\n" % (tags[tag], tag)) for tag in tags]) |
210 if newlines == oldlines: | 213 if newlines == oldlines: |
211 return None, None | 214 return None, None |
212 data = "".join(newlines) | 215 data = "".join(newlines) |