[PATCH 2 of 2] convert/gnuarch: recode cat-log parts to utf-8 to be hg.description friendly

Edouard Gomez ed.gomez at free.fr
Sun Jan 4 11:45:00 CST 2009


# HG changeset patch
# User Edouard Gomez <ed.gomez at free.fr>
# Date 1231091079 -3600
# Node ID ea0ccc5d63e00c1799ff45198322b1a594bca05d
# Parent  6563a8f9e9a7f7340c5aef0fe270470dc3389bcd
convert/gnuarch: recode cat-log parts to utf-8 to be hg.description friendly

diff --git a/hgext/convert/gnuarch.py b/hgext/convert/gnuarch.py
--- a/hgext/convert/gnuarch.py
+++ b/hgext/convert/gnuarch.py
@@ -263,14 +263,23 @@
     def _parsecatlog(self, data, rev):
         try:
             catlog = self.catlogparser.parsestr(data)
+
+            # Commit date
             self.changes[rev].date = util.datestr(
                 util.strdate(catlog['Standard-date'],
                              '%Y-%m-%d %H:%M:%S'))
-            self.changes[rev].author = catlog['Creator']
-            self.changes[rev].summary = '\n\n'.join(catlog['Summary'], 
-                                                    catlog.get_payload())
+
+            # Commit author
+            self.changes[rev].author = self.recode(catlog['Creator'])
+
+            # Commit description
+            self.changes[rev].summary = '\n\n'.join((catlog['Summary'], 
+                                                    catlog.get_payload()))
+            self.changes[rev].summary = self.recode(self.changes[rev].summary)
+
+            # Commit revision origin when dealing with a branch or tag
             if catlog.has_key('Continuation-of'):
-                self.changes[rev].continuationof = catlog['Continuation-of']
+                self.changes[rev].continuationof = self.recode(catlog['Continuation-of'])
 	except Exception, err:
             raise util.Abort(_('could not parse cat-log of %s') % rev)
 


More information about the Mercurial-devel mailing list