hgext/convert/hg.py
changeset 25570 7cc1d33f0ba6
parent 25558 daf9f7ee2a5c
child 25571 1abfe639a70c
--- a/hgext/convert/hg.py	Sat Jun 13 00:51:43 2015 -0700
+++ b/hgext/convert/hg.py	Sun Jun 14 13:04:00 2015 -0400
@@ -243,7 +243,7 @@
 
         if self.branchnames and commit.branch:
             extra['branch'] = commit.branch
-        if commit.rev:
+        if commit.rev and commit.saverev:
             extra['convert_revision'] = commit.rev
 
         while parents:
@@ -473,15 +473,13 @@
     def getcommit(self, rev):
         ctx = self.changectx(rev)
         parents = [p.hex() for p in self.parents(ctx)]
-        if self.saverev:
-            crev = rev
-        else:
-            crev = None
+        crev = rev
+
         return commit(author=ctx.user(),
                       date=util.datestr(ctx.date(), '%Y-%m-%d %H:%M:%S %1%2'),
                       desc=ctx.description(), rev=crev, parents=parents,
                       branch=ctx.branch(), extra=ctx.extra(),
-                      sortkey=ctx.rev())
+                      sortkey=ctx.rev(), saverev=self.saverev)
 
     def gettags(self):
         # This will get written to .hgtags, filter non global tags out.