Commits

Jesper Nøhr  committed 0aa6d21

hg repo speaks unicode, unbreak log with utf-8 in it

  • Participants
  • Parent commits 019c16a

Comments (0)

Files changed (1)

File heechee/repo/hg.py

 from mercurial import ui as ui_
 from mercurial.context import memctx, memfilectx
 
+try:
+    from mercurial.encoding import tolocal
+except ImportError:
+    from mercurial.util import tolocal
 
 class Repository(RepositoryBase):
     
             changectx = self.hg_repo[i - 1]
             yield {
                 "rev": i,
-                "comment": changectx.description(),
-                "author": changectx.user(),
+                "comment": unicode(tolocal(changectx.description()), 'utf-8'),
+                "author": unicode(tolocal(changectx.user()), 'utf-8'),
                 "date": datetime.datetime.fromtimestamp(changectx.date()[0]),
             }