merge with main
authorThomas Arendsen Hein <thomas@intevation.de>
Fri, 04 Jan 2008 07:44:07 +0100
changeset 5795 520a8d9d92ed
parent 5794 4c16020d1172 (diff)
parent 5792 956e01c31914 (current diff)
child 5796 7705d308eb5e
merge with main
--- a/hgext/convert/convcmd.py	Thu Jan 03 20:27:32 2008 -0600
+++ b/hgext/convert/convcmd.py	Fri Jan 04 07:44:07 2008 +0100
@@ -248,6 +248,10 @@
                 desc = self.commitcache[c].desc
                 if "\n" in desc:
                     desc = desc.splitlines()[0]
+                # 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.copy(c)
 
@@ -276,7 +280,11 @@
             self.source.after()
         self.map.close()
 
+orig_encoding = 'ascii'
+
 def convert(ui, src, dest=None, revmapfile=None, **opts):
+    global orig_encoding
+    orig_encoding = util._encoding
     util._encoding = 'UTF-8'
 
     if not dest:
--- a/hgext/convert/subversion.py	Thu Jan 03 20:27:32 2008 -0600
+++ b/hgext/convert/subversion.py	Fri Jan 04 07:44:07 2008 +0100
@@ -51,7 +51,10 @@
     except SubversionException:
         pass
     if os.path.isdir(path):
-        return 'file://%s' % os.path.normpath(os.path.abspath(path))
+        path = os.path.normpath(os.path.abspath(path))
+        if os.name == 'nt':
+            path = '/' + path.replace('\\', '/')
+        return 'file://%s' % path
     return path
 
 def optrev(number):