﻿Index: tracext/hg/backend.py
===================================================================
--- tracext/hg/backend.py	(revision 9175)
+++ tracext/hg/backend.py	(working copy)
@@ -610,7 +610,7 @@
         for rev in xrange(n_rev, -1, -1):
             for f in self.repos.repo.changectx(rev).files():
                 for d in dirnames[:]:
-                    if f.startswith(d):
+                    if unicode(f,'latin-1').startswith(d):
                         dirnodes[d] = log.node(rev)
                         dirnames.remove(d)
                         if not dirnames: # if nothing left to find
@@ -633,7 +633,7 @@
             entries = {}
             for file in self.manifest.keys():
                 if file.startswith(dir):
-                    entry = file[len(dir):].split('/', 1)[0]
+                    entry = unicode(file[len(dir):].split('/', 1)[0], 'latin-1') 
                     entries[entry] = 1
             if entries:
                 kind = Node.DIRECTORY
@@ -657,7 +657,7 @@
         self.time = self.repos.hg_time(log.read(node)[2])
         rev = self.repos.hg_display(node)
         Node.__init__(self, path, rev, kind)
-        self.created_path = path
+        self.created_path = unicode(path, 'latin-1')
         self.created_rev = rev
         self.node = node
         self.data = None
@@ -885,16 +885,17 @@
         renames = {}
         changes = []
         for f in self.files: # 'added' and 'edited' files
+            f2 = unicode(f, 'latin-1')
             if f in deletions: # and since Mercurial > 0.7 [hg c6ffedc4f11b]
                 continue          # also 'deleted' files
             action = None
             # TODO: find a way to detect conflicts and show how they were solved
             if manifest1 and f in manifest1:
                 action = Changeset.EDIT                
-                changes.append((f, Node.FILE, action, f, self.parents[0]))
+                changes.append((f2, Node.FILE, action, f, self.parents[0]))
             if manifest2 and f in manifest2:
                 action = Changeset.EDIT                
-                changes.append((f, Node.FILE, action, f, self.parents[1]))
+                changes.append((f2, Node.FILE, action, f, self.parents[1]))
 
             if not action:
                 rename_info = repo.file(f).renamed(manifest[f])
@@ -911,11 +912,12 @@
                     action = Changeset.ADD
                     base_path = ''
                     base_rev = None
-                changes.append((f, Node.FILE, action, base_path, base_rev))
+                changes.append((f2, Node.FILE, action, base_path, base_rev))
 
         for f, p in deletions.items():
+            f2 = unicode(f, 'latin-1')
             if f not in renames:
-                changes.append((f, Node.FILE, Changeset.DELETE, f, p))
+                changes.append((f2, Node.FILE, Changeset.DELETE, f, p))
         changes.sort()
         for change in changes:
             yield change

