by
Changes to 6 files · Browse files at baf2179c24a1 Showing diff from parent 4ac62b74dc45 add2630acc11 Diff from another changeset...
@@ -10,7 +10,7 @@ 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):
@@ -21,7 +21,7 @@
# 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')
@@ -66,7 +66,7 @@ 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("...")
@@ -127,7 +127,7 @@
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 == "":
@@ -171,7 +171,7 @@ 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)
|
@@ -626,9 +626,7 @@ # disable/enable menus as required
parents = [self.repo.changelog.rev(x.node()) for x in
self.repo.changectx(None).parents()]
- can_merge = selrev not in parents and \
- len(self.repo.heads()) > 1 and \
- len(parents) < 2
+ can_merge = selrev not in parents and len(parents) < 2
self._cmenu_merge.set_sensitive(can_merge)
# display the context menu
|
@@ -35,7 +35,7 @@ set_tortoise_icon(self, 'menulog.ico')
# set dialog title
title = "hg log "
- if root: title += " - %s" % root
+ if root: title += " - %s" % hglib.toutf(root)
self.set_title(title)
self.root = root
@@ -118,7 +118,8 @@ def _cursor_changed(self, tv):
model, selpaths = tv.get_selection().get_selected_rows()
if not selpaths: return
- cs = model[selpaths[0]][1]
+ index = selpaths[0][0]
+ cs = self.history[index]['changeset'][0]
rev, csid = cs.split(':')
self.selected = (rev, csid)
|
@@ -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
|
@@ -19,7 +19,7 @@ from mercurial import cmdutil, util, ui, hg, commands, patch, mdiff
from mercurial import merge as merge_
from shlib import shell_notify
-from hglib import toutf, rootpath, diffexpand
+from hglib import toutf, fromutf, rootpath, diffexpand
from gdialog import *
from dialog import entry_dialog
import hgshelve
@@ -555,8 +555,8 @@
# List of the currently checked and selected files to pass on to the new data
model, paths = self.filetree.get_selection().get_selected_rows()
- recheck = [entry[FM_PATH_UTF8] for entry in model if entry[FM_CHECKED]]
- reselect = [model[path][FM_PATH_UTF8] for path in paths]
+ recheck = [entry[FM_PATH] for entry in model if entry[FM_CHECKED]]
+ reselect = [model[path][FM_PATH] for path in paths]
# merge-state of files
ms = merge_.mergestate(self.repo)
@@ -575,7 +575,7 @@ selection = self.filetree.get_selection()
selected = False
for row in model:
- if row[FM_PATH_UTF8] in reselect:
+ if row[FM_PATH] in reselect:
selection.select_iter(row.iter)
selected = True
@@ -824,7 +824,7 @@ if not sel:
self._last_file = None
return False
- wfile = self.filemodel[sel[0]][FM_PATH_UTF8]
+ wfile = self.filemodel[sel[0]][FM_PATH]
if force or wfile != self._last_file:
self._last_file = wfile
self._hg_call_wrapper('Diff', dohgdiff)
@@ -1145,7 +1145,7 @@ return True
# move the files to dest directory
- move_list.append(destdir)
+ move_list.append(fromutf(destdir))
self._hg_move(move_list)
else:
Prompt('Nothing Moved', 'No movable files selected\n\n'
|
@@ -14,7 +14,7 @@ from mercurial import util, hg, ui
from mercurial.node import *
from shlib import shell_notify, set_tortoise_icon
-from hglib import rootpath, RepoError
+from hglib import rootpath, toutf, RepoError
class UpdateDialog(gtk.Window):
""" Dialog to update Mercurial repo """
@@ -34,7 +34,7 @@ return None
# set dialog title
- title = "hg update - %s" % self.cwd
+ title = "hg update - %s" % toutf(self.cwd)
self.set_title(title)
self._create()
|
Loading...