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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.