Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.7, 0.7.1, and 0.7.2

rename: make simple rename dialog UTF8 clean

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

Changeset a4a85a0715fe

Parent 4ec490bf54d9

by Steve Borho

Changes to one file · Browse files at a4a85a0715fe Showing diff from parent 4ec490bf54d9 Diff from another changeset...

Change 1 of 3 Show Entire File hggtk/​rename.py Stacked
 
15
16
17
18
 
19
20
21
 
383
384
385
386
387
388
 
 
 
 
 
389
390
391
 
405
406
407
408
 
409
410
411
 
15
16
17
 
18
19
20
21
 
383
384
385
 
 
 
386
387
388
389
390
391
392
393
 
407
408
409
 
410
411
412
413
@@ -15,7 +15,7 @@
 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 @@ -383,9 +383,11 @@
  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) @@ -405,7 +407,7 @@
  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