convert: display source revision id with --verbose
authorPatrick Mezard <pmezard@gmail.com>
Sat, 26 Jan 2008 14:45:04 +0100
changeset 5954 851402e53337
parent 5953 e7f1be4bf40a
child 5955 c4496b7c10ce
convert: display source revision id with --verbose
hgext/convert/convcmd.py
tests/test-convert-svn-source
tests/test-convert-svn-source.out
--- a/hgext/convert/convcmd.py	Fri Jan 25 19:49:15 2008 -0500
+++ b/hgext/convert/convcmd.py	Sat Jan 26 14:45:04 2008 +0100
@@ -230,6 +230,10 @@
         self.map[rev] = newnode
 
     def convert(self):
+
+        def recode(s):
+            return s.decode('utf-8').encode(orig_encoding, 'replace')
+
         try:
             self.source.before()
             self.dest.before()
@@ -251,8 +255,8 @@
                 # convert log message to local encoding without using
                 # tolocal() because util._encoding conver() use it as
                 # 'utf-8'
-                desc = desc.decode('utf-8').encode(orig_encoding, 'replace')
-                self.ui.status("%d %s\n" % (num, desc))
+                self.ui.status("%d %s\n" % (num, recode(desc)))
+                self.ui.note(_("source: %s\n" % recode(c)))
                 self.copy(c)
 
             tags = self.source.gettags()
--- a/tests/test-convert-svn-source	Fri Jan 25 19:49:15 2008 -0500
+++ b/tests/test-convert-svn-source	Sat Jan 26 14:45:04 2008 +0100
@@ -49,7 +49,7 @@
 cd ..
 
 echo % test incremental conversion
-hg convert $svnurl
+hg convert -v $svnurl | sed 's/source:.*/source:/'
 
 echo % test filemap
 echo 'include b' > filemap
--- a/tests/test-convert-svn-source.out	Fri Jan 25 19:49:15 2008 -0500
+++ b/tests/test-convert-svn-source.out	Sat Jan 26 14:45:04 2008 +0100
@@ -26,9 +26,14 @@
 % test incremental conversion
 assuming destination test-hg
 scanning source...
+fetching revision log for "/trunk/test" from 3 to 2
 sorting...
 converting...
 0 changeb
+source:
+a
+b
+no tags found at revision 3
 % test filemap
 initializing destination fmap repository
 scanning source...