##// END OF EJS Templates
convert: always track the hg source revision in the internal commit object...
Matt Harbison -
r25570:7cc1d33f default
parent child Browse files
Show More
@@ -44,7 +44,7 b" SKIPREV = 'SKIP'"
44 44
45 45 class commit(object):
46 46 def __init__(self, author, date, desc, parents, branch=None, rev=None,
47 extra={}, sortkey=None):
47 extra={}, sortkey=None, saverev=True):
48 48 self.author = author or 'unknown'
49 49 self.date = date or '0 0'
50 50 self.desc = desc
@@ -53,6 +53,7 b' class commit(object):'
53 53 self.rev = rev
54 54 self.extra = extra
55 55 self.sortkey = sortkey
56 self.saverev = saverev
56 57
57 58 class converter_source(object):
58 59 """Conversion source interface"""
@@ -243,7 +243,7 b' class mercurial_sink(converter_sink):'
243 243
244 244 if self.branchnames and commit.branch:
245 245 extra['branch'] = commit.branch
246 if commit.rev:
246 if commit.rev and commit.saverev:
247 247 extra['convert_revision'] = commit.rev
248 248
249 249 while parents:
@@ -473,15 +473,13 b' class mercurial_source(converter_source)'
473 473 def getcommit(self, rev):
474 474 ctx = self.changectx(rev)
475 475 parents = [p.hex() for p in self.parents(ctx)]
476 if self.saverev:
477 crev = rev
478 else:
479 crev = None
476 crev = rev
477
480 478 return commit(author=ctx.user(),
481 479 date=util.datestr(ctx.date(), '%Y-%m-%d %H:%M:%S %1%2'),
482 480 desc=ctx.description(), rev=crev, parents=parents,
483 481 branch=ctx.branch(), extra=ctx.extra(),
484 sortkey=ctx.rev())
482 sortkey=ctx.rev(), saverev=self.saverev)
485 483
486 484 def gettags(self):
487 485 # This will get written to .hgtags, filter non global tags out.
General Comments 0
You need to be logged in to leave comments. Login now