Follows attached the patch, it unify in a method the resolution of encoded
URLs and
is use widely (history, sync)
--
Att.
Diego de Oliveira
System Architect
di...@diegooliveira.com
www.diegooliveira.com
# HG changeset patch
# User Diego Oliveira <di...@diegooliveira.com>
# Date 1256667382 7200
# Branch stable
# Node ID 73ea5ec577076c286f825a767abd278b4a9e99f7
# Parent 281118d2117181ae258c711a9c7a570eb3527dde
wide correction of password encoded URLs
logic extracted to a method in the paths.py and used in history.py and sunc.py
diff -r 281118d21171 -r 73ea5ec57707 tortoisehg/hgtk/history.py
--- a/tortoisehg/hgtk/history.py Mon Oct 26 22:52:05 2009 -0500
+++ b/tortoisehg/hgtk/history.py Tue Oct 27 16:16:22 2009 -0200
@@ -18,7 +18,7 @@
from mercurial import ui, hg, cmdutil, commands, extensions, util, match, url
from tortoisehg.util.i18n import _
-from tortoisehg.util import hglib, thread2
+from tortoisehg.util import hglib, thread2, paths
from tortoisehg.hgtk.logview.treeview import TreeView as LogTreeView
@@ -1196,12 +1196,7 @@
atexit.register(cleanup)
bfile = path
-
- for alias, path_aux in self.repo.ui.configitems('paths'):
- if path == alias:
- path = path_aux
- elif path == url.hidepassword(path_aux):
- path = path_aux
+ path = paths.validate_synch_path(path, self.repo)
for badchar in (':', '*', '\\', '?', '#'):
bfile = bfile.replace(badchar, '')
@@ -1330,7 +1325,7 @@
q = Queue.Queue()
cmd = [q, 'outgoing', '--quiet', '--template', '{node}\n']
cmd += self.get_proxy_args()
- cmd += [path]
+ cmd += [paths.validate_synch_path(path, self.repo)]
def threadfunc(q, *args):
try:
diff -r 281118d21171 -r 73ea5ec57707 tortoisehg/hgtk/synch.py
--- a/tortoisehg/hgtk/synch.py Mon Oct 26 22:52:05 2009 -0500
+++ b/tortoisehg/hgtk/synch.py Tue Oct 27 16:16:22 2009 -0200
@@ -544,12 +544,9 @@
use_proxy = self.use_proxy.get_active()
text_entry = self.pathbox.get_child()
remote_path = hglib.fromutf(text_entry.get_text()).strip()
- for alias, path in self.paths:
- if remote_path == alias:
- remote_path = path
- elif remote_path == url.hidepassword(path):
- remote_path = path
-
+
+ remote_path = paths.validate_synch_path(remote_path, self.repo)
+
cmdline = cmd[:]
cmdline += ['--verbose']
if proxy_host and not use_proxy:
diff -r 281118d21171 -r 73ea5ec57707 tortoisehg/util/paths.py
--- a/tortoisehg/util/paths.py Mon Oct 26 22:52:05 2009 -0500
+++ b/tortoisehg/util/paths.py Tue Oct 27 16:16:22 2009 -0200
@@ -4,6 +4,7 @@
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2, incorporated herein by reference.
+from mercurial.url import url
try:
from config import icon_path, bin_path, license_path, locale_path
@@ -42,6 +43,16 @@
global locale_path
return locale_path or os.path.join(get_prog_root(), 'locale')
+
+def validate_synch_path(path, repo):
+ return_path = path
+ for alias, path_aux in repo.ui.configitems('paths'):
+ if path == alias:
+ return_path = path_aux
+ elif path == url.hidepassword(path_aux):
+ return_path = path_aux
+ return return_path
+
if os.name == 'nt':
import _winreg
import win32net
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop