changeset 4873:28b23b9073a8

convert: record the source revision in the changelog
author Brendan Cully <brendan@kublai.com>
date Fri, 13 Jul 2007 08:28:57 -0700
parents 419a6f715c6a
children d9e385a7a806
files hgext/convert/common.py hgext/convert/git.py hgext/convert/hg.py hgext/convert/subversion.py
diffstat 4 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/common.py
+++ b/hgext/convert/common.py
@@ -4,6 +4,9 @@ class NoRepo(Exception): pass
 
 class commit(object):
     def __init__(self, **parts):
+        self.rev = None
+        self.branch = None
+
         for x in "author date desc parents".split():
             if not x in parts:
                 raise util.Abort("commit missing field %s" % x)
--- a/hgext/convert/git.py
+++ b/hgext/convert/git.py
@@ -80,7 +80,8 @@ class convert_git(converter_source):
         date = tm + " " + str(tz)
         author = author or "unknown"
 
-        c = commit(parents=parents, date=date, author=author, desc=message)
+        c = commit(parents=parents, date=date, author=author, desc=message,
+                   rev=version)
         return c
 
     def gettags(self):
--- a/hgext/convert/hg.py
+++ b/hgext/convert/hg.py
@@ -54,11 +54,11 @@ class convert_mercurial(converter_sink):
 
         text = commit.desc
         extra = {}
-        try:
-            extra["branch"] = commit.branch
-        except AttributeError:
-            pass
-
+        if commit.branch:
+            extra['branch'] = commit.branch
+        if commit.rev:
+            extra['convert_revision'] = commit.rev
+            
         while parents:
             p1 = p2
             p2 = parents.pop(0)
--- a/hgext/convert/subversion.py
+++ b/hgext/convert/subversion.py
@@ -484,7 +484,8 @@ class convert_svn(converter_source):
                           desc=log, 
                           parents=parents,
                           copies=copies,
-                          branch=branch)
+                          branch=branch,
+                          rev=rev.encode('utf-8'))
 
             self.commits[rev] = cset
             if self.child_cset and not self.child_cset.parents: