convert/gnuarch: recode cat-log parts to utf-8 to be hg.description friendly
authorEdouard Gomez <ed.gomez@free.fr>
Sun, 04 Jan 2009 18:44:39 +0100
changeset 7592 75ad51257c82
parent 7591 cac40e310f92
child 7593 9811cc670c51
child 7596 0be97ee2309d
convert/gnuarch: recode cat-log parts to utf-8 to be hg.description friendly
hgext/convert/gnuarch.py
--- a/hgext/convert/gnuarch.py	Sun Jan 04 18:44:30 2009 +0100
+++ b/hgext/convert/gnuarch.py	Sun Jan 04 18:44:39 2009 +0100
@@ -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)