Commits

Steve Borho committed a4a85a0

rename: make simple rename dialog UTF8 clean

Display filenames in UTF8, convert user input from UTF8
Fixes #24

Comments (0)

Files changed (1)

 import thread2
 from dialog import error_dialog
 from mercurial import hg, ui, mdiff, cmdutil, match, util, commands
-from hglib import toutf, diffexpand, rootpath
+from hglib import toutf, fromutf, diffexpand, rootpath
 import gtklib
 try:
     from mercurial.repo import RepoError
         if cwd: os.chdir(cwd)
         fname = util.normpath(fname)
         if target:
-            target = util.normpath(target)
-        title = 'Rename ' + fname
-        dialog = entry_dialog(None, title, True, target or fname, rename_resp)
+            target = toutf(util.normpath(target))
+        else:
+            target = toutf(fname)
+        title = 'Rename ' + toutf(fname)
+        dialog = entry_dialog(None, title, True, target, rename_resp)
         dialog.orig = fname
         dialog.show_all()
         dialog.connect('destroy', gtk.main_quit)
         gtk.main_quit()
         return
 
-    new_name = dialog.entry.get_text()
+    new_name = fromutf(dialog.entry.get_text())
     opts = {}
     opts['force'] = False # Checkbox? Nah.
     opts['after'] = False
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.