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

synch: remove launch of changelog from synchronize tool

Removes a lot of unnecessary complexity and source of bugs. In the 0.9
timeframe people should wean themselves from using the synchronize tool
outside of the changelog tool. It is likely to be removed in a future
release.

Changeset a2dd1d3959eb

Parent 412e1e00ffe0

by Steve Borho

Changes to 2 files · Browse files at a2dd1d3959eb Showing diff from parent 412e1e00ffe0 Diff from another changeset...

 
77
78
79
 
 
 
 
 
80
81
82
83
84
85
86
87
88
89
 
154
155
156
157
 
158
159
160
 
164
165
166
167
 
168
169
170
171
 
172
173
174
 
374
375
376
377
 
378
379
380
 
1547
1548
1549
1550
1551
 
 
1552
1553
1554
 
77
78
79
80
81
82
83
84
85
 
 
 
 
 
 
86
87
88
 
153
154
155
 
156
157
158
159
 
163
164
165
 
166
167
168
169
 
170
171
172
173
 
373
374
375
 
376
377
378
379
 
1546
1547
1548
 
 
1549
1550
1551
1552
1553
@@ -77,13 +77,12 @@
  self.refresh_clicked,   tip=_('Reload revision history')),   gtk.SeparatorToolItem(), + self.make_toolbutton(gtk.STOCK_NETWORK, + _('Synchronize'), + self.synch_clicked, + tip=_('Launch synchronize tool')), + gtk.SeparatorToolItem(),   ] - if not self.opts.get('from-synch'): - self.synctb = self.make_toolbutton(gtk.STOCK_NETWORK, - _('Synchronize'), - self.synch_clicked, - tip=_('Launch synchronize tool')) - tbar += [self.synctb, gtk.SeparatorToolItem()]   if 'mq' in self.exs:   self.mqtb = self.make_toolbutton(gtk.STOCK_DIRECTORY,   _('MQ'), @@ -154,7 +153,7 @@
    def synch_clicked(self, toolbutton, data):   def sync_closed(dialog): - self.synctb.set_sensitive(True) + self.get_toolbutton(_('Synchronize')).set_sensitive(True)     def synch_callback(parents):   self.repo.invalidate() @@ -164,11 +163,11 @@
    from tortoisehg.hgtk import synch   parents = [x.node() for x in self.repo.parents()] - dlg = synch.SynchDialog([], False, True) + dlg = synch.SynchDialog([], False)   dlg.set_notify_func(synch_callback, parents)   dlg.connect('destroy', sync_closed)   dlg.show_all() - self.synctb.set_sensitive(False) + self.get_toolbutton(_('Synchronize')).set_sensitive(False)     def toggle_view_column(self, button, property):   active = button.get_active() @@ -374,7 +373,7 @@
  root = self.repo.root   os.chdir(root) # for paths relative to repo root   - self.origtip = self.opts['orig-tip'] or len(self.repo) + self.origtip = len(self.repo)   self.graphview.set_property('branch-color', self.branch_color)     # ignore file patterns that imply repo root @@ -1547,8 +1546,8 @@
  'follow':False, 'follow-first':False, 'copies':False, 'keyword':[],   'limit':0, 'rev':[], 'removed':False, 'no_merges':False,   'date':None, 'only_merges':None, 'prune':[], 'git':False, - 'verbose':False, 'include':[], 'exclude':[], 'from-synch':False, - 'orig-tip':None, 'filehist':None, 'canonpats':[] + 'verbose':False, 'include':[], 'exclude':[], 'filehist':None, + 'canonpats':[]   }   cmdoptions.update(opts)   pats = hglib.canonpaths(pats) + cmdoptions['canonpats']
 
20
21
22
23
 
24
25
26
27
 
28
29
30
 
33
34
35
36
37
38
39
 
49
50
51
52
53
54
55
 
269
270
271
272
273
274
275
276
277
278
279
 
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
 
 
 
 
 
 
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
 
20
21
22
 
23
24
25
26
 
27
28
29
30
 
33
34
35
 
36
37
38
 
48
49
50
 
51
52
53
 
267
268
269
 
 
270
271
 
272
273
274
 
328
329
330
 
331
332
333
334
335
 
 
 
 
 
 
 
 
336
337
338
339
340
341
342
343
 
 
 
 
 
 
 
 
 
 
344
345
 
 
 
 
 
346
347
348
@@ -20,11 +20,11 @@
 from tortoisehg.util.i18n import _  from tortoisehg.util import hglib, settings, paths   -from tortoisehg.hgtk import dialog, gtklib, hgthread, history, thgconfig +from tortoisehg.hgtk import dialog, gtklib, hgthread, thgconfig  from tortoisehg.hgtk import thgshelve, hgemail, update    class SynchDialog(gtk.Window): - def __init__(self, repos=[], pushmode=False, fromlog=False): + def __init__(self, repos=[], pushmode=False):   """ Initialize the Dialog. """   gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)   gtklib.set_tortoise_icon(self, 'menusynch.ico') @@ -33,7 +33,6 @@
  self.root = paths.find_root()   self.selected_path = None   self.hgthread = None - self.fromlog = fromlog   self.notify_func = None   self.last_drop_time = None   self.lastcmd = [] @@ -49,7 +48,6 @@
  self.set_default_size(655, 552)     self.paths = self.get_paths() - self.origchangecount = len(self.repo)     name = self.repo.ui.config('web', 'name') or os.path.basename(self.root)   self.set_title(_('TortoiseHg Synchronize - ') + hglib.toutf(name)) @@ -269,11 +267,8 @@
    def create_bottombox(self):   self.buttonhbox = gtk.HBox() - self.viewpulled = gtk.Button(_('View pulled revisions')) - self.viewpulled.connect('clicked', self._view_pulled_changes)   self.updatetip = gtk.Button(_('Update to branch tip'))   self.updatetip.connect('clicked', self._update_to_tip) - self.buttonhbox.pack_start(self.viewpulled, False, False, 2)   self.buttonhbox.pack_start(self.updatetip, False, False, 2)   self.basevbox.pack_start(self.buttonhbox, False, False, 2)   @@ -333,39 +328,21 @@
  self.pathtext.set_text(hglib.toutf(path))     def update_buttons(self): - self.buttonhbox.hide()   try:   # open a new repo, rebase can confuse cached repo   repo = hg.repository(ui.ui(), path=self.root)   except hglib.RepoError:   return - tip = len(repo) - if ' '.join(self.lastcmd[:2]) == 'pull --rebase': - # if last operation was a rebase, do not show 'viewpulled' - # and reset our remembered tip changeset - self.origchangecount = tip - self.viewpulled.hide() - elif self.origchangecount == tip or self.fromlog: - self.viewpulled.hide() + + wc = repo[None] + bhead = repo.branchtags().get(wc.branch()) + parents = repo.parents() + if len(parents) > 1 or parents[0].node() == bhead or not bhead: + self.buttonhbox.hide()   else:   self.buttonhbox.show() - self.viewpulled.show() - - wc = repo[None] - branchhead = repo.branchtags().get(wc.branch()) - parents = repo.parents() - if len(parents) > 1 or parents[0].node() == branchhead or not branchhead: - self.updatetip.hide() - else: - self.buttonhbox.show() - self.updatetip.show()   self.repo = repo   - def _view_pulled_changes(self, button): - opts = {'orig-tip' : self.origchangecount, 'from-synch' : True} - dlg = history.run(self.ui, **opts) - dlg.display() -   def _update_to_tip(self, button):   def update_notify(arg):   if self.notify_func: