Commits

Yuya Nishihara committed 2f9f05e

grep: fix unicode handling of several context menu actions (fixes #2274)

1cdbd7bbd063 fixed rendering of non-ascii filenames, but it broke context
menu actions.

Comments (0)

Files changed (1)

tortoisehg/hgqt/grep.py

         from tortoisehg.hgqt.run import qtrun
         repo, ui, pattern, icase = self.repo, self.repo.ui, self.pattern, self.icase
         seen = set()
-        for rev, path, line in self.selectedRows:
+        for rev, upath, line in self.selectedRows:
+            path = hglib.fromunicode(upath)
             # Only open one annotate instance per file
             if path in seen:
                 continue
     def onViewFile(self):
         repo, ui, pattern = self.repo, self.repo.ui, self.pattern
         seen = set()
-        for rev, path, line in self.selectedRows:
+        for rev, upath, line in self.selectedRows:
+            path = hglib.fromunicode(upath)
             # Only open one editor instance per file
             if path in seen:
                 continue
                 else:
                     defer.append([rev, path, line])
             if crev is not None:
-                dlg = visdiff.visualdiff(ui, repo, list(files), {'change':crev})
+                dlg = visdiff.visualdiff(ui, repo,
+                                         map(hglib.fromunicode, files),
+                                         {'change':crev})
                 if dlg:
                     dlg.exec_()
             rows = defer