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

synch: handle non-ascii paths and aliases

fixes #76 Required follow-on fixes in thgconfig and hgemail

Changeset 6672b0fb50c1

Parent f43f49cb77ad

by Steve Borho

Changes to 3 files · Browse files at 6672b0fb50c1 Showing diff from parent f43f49cb77ad Diff from another changeset...

Change 1 of 3 Show Entire File hggtk/​hgemail.py Stacked
 
13
14
15
16
 
17
18
19
 
195
196
197
198
199
200
201
 
 
 
 
202
203
204
 
237
238
239
240
241
242
243
 
 
 
 
244
245
246
 
13
14
15
 
16
17
18
19
 
195
196
197
 
 
 
 
198
199
200
201
202
203
204
 
237
238
239
 
 
 
 
240
241
242
243
244
245
246
@@ -13,7 +13,7 @@
 from tempfile import mkstemp  from dialog import *  from mercurial import hg, ui, extensions -from hglib import RepoError +from hglib import RepoError, fromutf, toutf  from thgconfig import ConfigDialog  from hgcmd import CmdDialog   @@ -195,10 +195,10 @@
    if initial:   # Only zap these fields at startup - self._tobox.child.set_text(repo.ui.config('email', 'to', '')) - self._ccbox.child.set_text(repo.ui.config('email', 'cc', '')) - self._frombox.child.set_text(repo.ui.config('email', 'from', '')) - self._subjbox.child.set_text(repo.ui.config('email', 'subject', '')) + self._tobox.child.set_text(fromutf(repo.ui.config('email', 'to', ''))) + self._ccbox.child.set_text(fromutf(repo.ui.config('email', 'cc', ''))) + self._frombox.child.set_text(fromutf(repo.ui.config('email', 'from', ''))) + self._subjbox.child.set_text(fromutf(repo.ui.config('email', 'subject', '')))   fill_history(history, self._tolist, 'email.to')   fill_history(history, self._cclist, 'email.cc')   fill_history(history, self._fromlist, 'email.from') @@ -237,10 +237,10 @@
  history.get_value(cpath).remove(newvalue)   history.get_value(cpath).insert(0, newvalue)   - totext = self._tobox.child.get_text() - cctext = self._ccbox.child.get_text() - fromtext = self._frombox.child.get_text() - subjtext = self._subjbox.child.get_text() + totext = fromutf(self._tobox.child.get_text()) + cctext = fromutf(self._ccbox.child.get_text()) + fromtext = fromutf(self._frombox.child.get_text()) + subjtext = fromutf(self._subjbox.child.get_text())     if not totext:   info_dialog(self, 'Info required', 'You must specify a recipient')
Change 1 of 7 Show Entire File hggtk/​synch.py Stacked
 
130
131
132
133
 
134
135
136
 
222
223
224
225
 
226
227
228
 
230
231
232
233
 
234
235
236
 
243
244
245
246
 
247
248
 
249
250
251
 
433
434
435
436
 
437
438
439
 
451
452
453
454
 
455
456
457
 
500
501
502
503
 
504
505
506
 
130
131
132
 
133
134
135
136
 
222
223
224
 
225
226
227
228
 
230
231
232
 
233
234
235
236
 
243
244
245
 
246
247
 
248
249
250
251
 
433
434
435
 
436
437
438
439
 
451
452
453
 
454
455
456
457
 
500
501
502
 
503
504
505
506
@@ -130,7 +130,7 @@
  defpushrow = i     if repos: - self._pathtext.set_text(repos[0]) + self._pathtext.set_text(toutf(repos[0]))   elif defpushrow is not None and pushmode:   self._pathbox.set_active(defpushrow)   elif defrow is not None: @@ -222,7 +222,7 @@
  sympaths = []   for name, path in self.paths:   sympaths.append(path) - self.pathlist.append([path, name, False]) + self.pathlist.append([toutf(path), name, False])   separator = False   for p in self._recent_src:   if p in sympaths: @@ -230,7 +230,7 @@
  if not separator:   self.pathlist.append(['-'*20, '', True])   separator = True - self.pathlist.append([p, '', False]) + self.pathlist.append([toutf(p), '', False])     def _drag_receive(self, widget, context, x, y, selection, targetType, time):   if time != self._last_drop_time: @@ -243,9 +243,9 @@
  return   path = urllib.unquote(uri[7:])   if rootpath(path) == path: - self._pathtext.set_text(path) + self._pathtext.set_text(toutf(path))   elif not os.path.isdir(path) and path.endswith('.hg'): - self._pathtext.set_text(path) + self._pathtext.set_text(toutf(path))     def update_buttons(self, *args):   self.buttonhbox.hide() @@ -433,7 +433,7 @@
  self._exec_cmd(cmd)     def _conf_clicked(self, toolbutton, data=None): - newpath = self._pathtext.get_text().strip() + newpath = fromutf(self._pathtext.get_text()).strip()   for name, path in self.paths:   if path == newpath:   newpath = None @@ -451,7 +451,7 @@
  self.fill_path_combo()     def _email_clicked(self, toolbutton, data=None): - path = self._pathtext.get_text().strip() + path = fromutf(self._pathtext.get_text()).strip()   if not path:   info_dialog(self, 'No repository selected',   'Select a peer repository to compare with') @@ -500,7 +500,7 @@
  proxy_host = ui.ui().config('http_proxy', 'host', '')   use_proxy = self._use_proxy.get_active()   text_entry = self._pathbox.get_child() - remote_path = fromutf(text_entry.get_text().strip()) + remote_path = fromutf(text_entry.get_text()).strip()     cmdline = cmd[:]   cmdline += ['--verbose', '--repository', self.root]
 
11
12
13
14
 
15
16
17
 
252
253
254
255
256
 
 
257
258
259
 
263
264
265
266
267
 
268
269
270
271
272
273
274
 
275
276
277
 
349
350
351
352
 
353
354
355
 
391
392
393
394
 
395
396
397
 
476
477
478
479
 
480
481
482
 
486
487
488
489
 
490
491
492
493
494
495
496
 
497
498
499
 
573
574
575
576
 
577
578
579
 
11
12
13
 
14
15
16
17
 
252
253
254
 
 
255
256
257
258
259
 
263
264
265
 
 
266
267
268
269
270
271
 
 
272
273
274
275
 
347
348
349
 
350
351
352
353
 
389
390
391
 
392
393
394
395
 
474
475
476
 
477
478
479
480
 
484
485
486
 
487
488
489
490
491
492
493
 
494
495
496
497
 
571
572
573
 
574
575
576
577
@@ -11,7 +11,7 @@
 import pango  from mercurial import hg, ui, cmdutil, util  from dialog import error_dialog, question_dialog -from hglib import RepoError +from hglib import RepoError, toutf, fromutf  import shlib  import shelve  import iniparse @@ -252,8 +252,8 @@
  if name in ('default', 'default-push'): continue   path = self.ini['paths'][name]   i = self.pathdata.insert_before(None, None) - self.pathdata.set_value(i, 0, "%s" % name) - self.pathdata.set_value(i, 1, "%s" % path) + self.pathdata.set_value(i, 0, "%s" % toutf(name)) + self.pathdata.set_value(i, 1, "%s" % toutf(path))     # Define view model for 'Paths' tab   self.pathtree = gtk.TreeView() @@ -263,15 +263,13 @@
  renderer = gtk.CellRendererText()   renderer.set_property('editable', True)   renderer.connect('edited', self.on_alias_edit) - column = gtk.TreeViewColumn('Alias', - renderer, text=0) + column = gtk.TreeViewColumn('Alias', renderer, text=0)   self.pathtree.append_column(column)     renderer = gtk.CellRendererText()   renderer.set_property('editable', True)   renderer.connect('edited', self.on_path_edit) - column = gtk.TreeViewColumn('Repository Path', - renderer, text=1) + column = gtk.TreeViewColumn('Repository Path', renderer, text=1)   self.pathtree.append_column(column)     scrolledwindow = gtk.ScrolledWindow() @@ -349,7 +347,7 @@
  '''Add a new path to [paths], give default name, focus'''   i = self.pathdata.insert_before(None, None)   self.pathdata.set_value(i, 0, 'new') - self.pathdata.set_value(i, 1, '%s' % newpath) + self.pathdata.set_value(i, 1, '%s' % toutf(newpath))   self.pathtree.get_selection().select_iter(i)   self.pathtree.set_cursor(   self.pathdata.get_path(i), @@ -391,7 +389,7 @@
  'Path testing cannot work without a repository')   return   model, path = selection.get_selected() - testpath = model[path][1] + testpath = fromutf(model[path][1])   if not testpath:   return   if testpath[0] == '~': @@ -476,7 +474,7 @@
  if values:   vlist.append(['Suggested', True])   for v in values: - vlist.append([v, False]) + vlist.append([toutf(v), False])   if v == curvalue:   currow = len(vlist) - 1   if cpath in self.history.get_keys(): @@ -486,14 +484,14 @@
  if not separator:   vlist.append(['History', True])   separator = True - vlist.append([v, False]) + vlist.append([toutf(v), False])   if v == curvalue:   currow = len(vlist) - 1     if curvalue is None:   combo.set_active(0)   elif currow is None: - combo.child.set_text(curvalue) + combo.child.set_text(toutf(curvalue))   else:   combo.set_active(currow)   @@ -573,7 +571,7 @@
  # Flush changes on all pages   for vbox, info, widgets in self.pages:   for w, (label, cpath, values, tip) in enumerate(info): - newvalue = widgets[w].child.get_text() + newvalue = fromutf(widgets[w].child.get_text())   self.record_new_value(cpath, newvalue)     self.history.write()