Mercurial > hg
comparison hgext/convert/hg.py @ 25570:7cc1d33f0ba6
convert: always track the hg source revision in the internal commit object
This will be needed in the next patch to determine if phases need to be
adjusted. The insertion of the source revision in 'extras{}' is still
controlled by the config property.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 14 Jun 2015 13:04:00 -0400 |
parents | daf9f7ee2a5c |
children | 1abfe639a70c |
comparison
equal
deleted
inserted
replaced
25569:2612e6dab189 | 25570:7cc1d33f0ba6 |
---|---|
241 | 241 |
242 extra[label] = newrev | 242 extra[label] = newrev |
243 | 243 |
244 if self.branchnames and commit.branch: | 244 if self.branchnames and commit.branch: |
245 extra['branch'] = commit.branch | 245 extra['branch'] = commit.branch |
246 if commit.rev: | 246 if commit.rev and commit.saverev: |
247 extra['convert_revision'] = commit.rev | 247 extra['convert_revision'] = commit.rev |
248 | 248 |
249 while parents: | 249 while parents: |
250 p1 = p2 | 250 p1 = p2 |
251 p2 = parents.pop(0) | 251 p2 = parents.pop(0) |
471 return copies | 471 return copies |
472 | 472 |
473 def getcommit(self, rev): | 473 def getcommit(self, rev): |
474 ctx = self.changectx(rev) | 474 ctx = self.changectx(rev) |
475 parents = [p.hex() for p in self.parents(ctx)] | 475 parents = [p.hex() for p in self.parents(ctx)] |
476 if self.saverev: | 476 crev = rev |
477 crev = rev | 477 |
478 else: | |
479 crev = None | |
480 return commit(author=ctx.user(), | 478 return commit(author=ctx.user(), |
481 date=util.datestr(ctx.date(), '%Y-%m-%d %H:%M:%S %1%2'), | 479 date=util.datestr(ctx.date(), '%Y-%m-%d %H:%M:%S %1%2'), |
482 desc=ctx.description(), rev=crev, parents=parents, | 480 desc=ctx.description(), rev=crev, parents=parents, |
483 branch=ctx.branch(), extra=ctx.extra(), | 481 branch=ctx.branch(), extra=ctx.extra(), |
484 sortkey=ctx.rev()) | 482 sortkey=ctx.rev(), saverev=self.saverev) |
485 | 483 |
486 def gettags(self): | 484 def gettags(self): |
487 # This will get written to .hgtags, filter non global tags out. | 485 # This will get written to .hgtags, filter non global tags out. |
488 tags = [t for t in self.repo.tagslist() | 486 tags = [t for t in self.repo.tagslist() |
489 if self.repo.tagtype(t[0]) == 'global'] | 487 if self.repo.tagtype(t[0]) == 'global'] |