Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

stable hglib: add logic to validate the sync path

unification of the sync path validation logic used in history.py and synch.py

Changeset 5463933cd03d

Parent d3d32fce6f9c

by Diego Oliveira

Changes to 3 files · Browse files at 5463933cd03d Showing diff from parent d3d32fce6f9c Diff from another changeset...

 
1196
1197
1198
 
1199
1200
1201
1202
1203
1204
1205
1206
1207
 
1330
1331
1332
1333
 
1334
1335
1336
 
1196
1197
1198
1199
1200
 
 
 
 
 
1201
1202
1203
 
1326
1327
1328
 
1329
1330
1331
1332
@@ -1196,12 +1196,8 @@
  atexit.register(cleanup)     bfile = path + path = hglib.validate_synch_path(path, self.repo)   - 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     for badchar in (':', '*', '\\', '?', '#'):   bfile = bfile.replace(badchar, '') @@ -1330,7 +1326,7 @@
  q = Queue.Queue()   cmd = [q, 'outgoing', '--quiet', '--template', '{node}\n']   cmd += self.get_proxy_args() - cmd += [path] + cmd += [hglib.validate_synch_path(path, self.repo)]     def threadfunc(q, *args):   try:
 
544
545
546
547
548
549
550
551
 
552
553
554
 
544
545
546
 
 
 
 
 
547
548
549
550
@@ -544,11 +544,7 @@
  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 = hglib.validate_synch_path(remote_path, self.repo)     cmdline = cmd[:]   cmdline += ['--verbose']
 
4
5
6
 
7
8
9
 
219
220
221
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
5
6
7
8
9
10
 
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
@@ -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    import os  import sys @@ -219,3 +220,17 @@
  if not author:   author = util.shortuser(user)   return author + +def validate_synch_path(path, repo): + ''' + Validate the path that must be used to sync operations (pull, + push, outgoing and incoming) + ''' + 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 +