Steve Borho avatar Steve Borho committed ddfbe8d

hginit: make UTF8 clean

fixes #25

Comments (0)

Files changed (1)

 import gtk
 from dialog import error_dialog, info_dialog
 from mercurial import hg, ui, util
-from hglib import RepoError
+from hglib import toutf, fromutf, RepoError
 import shlib
 
 class InitDialog(gtk.Window):
         
         # set dialog title and icon
         self.cwd = cwd and cwd or os.getcwd()
-        title = 'Hg init - %s' % (self.cwd)
+        title = 'Hg init - %s' % toutf(self.cwd)
         self.set_title(title)
         shlib.set_tortoise_icon(self, 'menucreaterepos.ico')
 
         lbl.set_property("width-chars", 12)
         lbl.set_alignment(0, 0.5)
         self._dest_input = gtk.Entry()
-        self._dest_input.set_text(self._dest_path)
+        self._dest_input.set_text(toutf(self._dest_path))
         self._dest_input.set_position(-1)
 
         self._btn_dest_browse = gtk.Button("...")
 
     def _btn_init_clicked(self, toolbutton, data=None):
         # gather input data
-        dest = self._dest_input.get_text()
+        dest = fromutf(self._dest_input.get_text())
         
         # verify input
         if dest == "":
                     pass
         
         info_dialog(self, "New repository created",
-                "in directory %s" % os.path.abspath(dest))
+                "in directory %s" % toutf(os.path.abspath(dest)))
 
 def run(cwd='', files=[], **opts):
     dialog = InitDialog(cwd, repos=files)
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.