changeset 7592:75ad51257c82

convert/gnuarch: recode cat-log parts to utf-8 to be hg.description friendly
author Edouard Gomez <ed.gomez@free.fr>
date Sun, 04 Jan 2009 18:44:39 +0100
parents cac40e310f92
children 9811cc670c51 0be97ee2309d
files hgext/convert/gnuarch.py
diffstat 1 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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)