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

changeset: add "Diff to second Parent" checkbutton

The checkbutton is placed at the bottom of the files pane and
only visible if a merge changeset has been selected.

Removing the previous "Other Parent" button and menu entry
in log viewer.

Changeset 2e8f70e45445

Parent 3c6800bfc863

by Adrian Buehlmann

Changes to 2 files · Browse files at 2e8f70e45445 Showing diff from parent 3c6800bfc863 Diff from another changeset...

 
27
28
29
 
30
31
32
 
41
42
43
44
45
46
47
48
49
50
51
 
52
53
54
55
56
57
58
59
60
61
 
62
63
64
 
81
82
83
 
 
 
 
 
84
85
86
87
88
 
 
89
90
91
92
93
94
 
 
95
96
97
98
 
99
100
101
102
103
104
105
 
106
107
108
 
271
272
273
274
 
275
276
277
 
579
580
581
582
 
 
 
 
 
 
 
 
 
 
 
583
584
585
 
27
28
29
30
31
32
33
 
42
43
44
 
 
 
 
 
 
 
 
45
46
47
 
 
48
49
50
51
52
 
53
54
55
56
 
73
74
75
76
77
78
79
80
81
82
83
 
 
84
85
86
87
88
89
 
 
90
91
92
93
94
 
95
96
97
98
99
100
101
 
102
103
104
105
 
268
269
270
 
271
272
273
274
 
576
577
578
 
579
580
581
582
583
584
585
586
587
588
589
590
591
592
@@ -27,6 +27,7 @@
  self.stbar = stbar   self.glog_parent = None   self.bfile = None + self.nothing_loaded = True     def get_title(self):   title = _('%s changeset ') % self.get_reponame() @@ -41,24 +42,15 @@
  return 'menushowchanged.ico'     def get_tbbuttons(self): - self.parent_toggle = gtk.ToggleToolButton(gtk.STOCK_UNDO) - self.parent_toggle.set_use_underline(True) - self.parent_toggle.set_label(_('_Other Parent')) - self.parent_toggle.set_tooltip(self.tooltips, _('diff other parent')) - self.parent_toggle.set_sensitive(False) - self.parent_toggle.set_active(False) - self.parent_toggle.connect('toggled', self.parent_toggled) - return [self.parent_toggle] + return []     def parent_toggled(self, button): - self.glog_parent.cmd_set_active( - 'other-parent', self.parent_toggle.get_active())   self.load_details(self.currev)     def prepare_display(self):   self.currow = None   self.graphview = None - self.glog_parent = None + self.glog_parent = NoneY   node0, node1 = cmdutil.revpair(self.repo, self.opts.get('rev'))   self.load_details(self.repo.changelog.rev(node0))   @@ -81,28 +73,33 @@
  if not ctx:   return   + if self.nothing_loaded: + self.other_parent_box.pack_start( + self.other_parent_checkbutton, False, False) + self.nothing_loaded = False +   parents = ctx.parents()   title = self.get_title()   if len(parents) == 2: - self.parent_toggle.set_sensitive(True) - if self.parent_toggle.get_active(): + self.other_parent_box.show_all() + if self.other_parent_checkbutton.get_active():   title += ':' + str(parents[1].rev())   else:   title += ':' + str(parents[0].rev())   else: - self.parent_toggle.set_sensitive(False) - if self.parent_toggle.get_active(): + self.other_parent_box.hide_all() + if self.other_parent_checkbutton.get_active():   # Parent button must be pushed out, but this   # will cause load_details to be called again   # so we exit out to prevent recursion. - self.parent_toggle.set_active(False) + self.other_parent_checkbutton.set_active(False)   return     if self.clipboard:   self.clipboard.set_text(str(ctx))     self.set_title(title) - if self.parent_toggle.get_active(): + if self.other_parent_checkbutton.get_active():   parent = parents[1].node()   elif parents:   parent = parents[0].node() @@ -271,7 +268,7 @@
    ismerge = (len(ctx.parents()) == 2)   - if ismerge and self.parent_toggle.get_active(): + if ismerge and self.other_parent_checkbutton.get_active():   parentindex = 1   else:   parentindex = 0 @@ -579,7 +576,17 @@
  scroller = gtk.ScrolledWindow()   scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)   scroller.add(filelist_tree) - list_frame.add(scroller) + flbox = gtk.VBox() + flbox.pack_start(scroller) + list_frame.add(flbox) + + self.other_parent_box = gtk.HBox() + flbox.pack_start(self.other_parent_box, False, False) + + btn = gtk.CheckButton(_('Diff to second Parent')) + btn.connect('toggled', self.parent_toggled) + # don't pack btn yet to keep it initially invisible + self.other_parent_checkbutton = btn     self._hpaned = gtk.HPaned()   self._hpaned.pack1(list_frame, True, True)
 
158
159
160
161
162
163
164
165
166
167
 
213
214
215
216
217
218
219
220
221
222
 
287
288
289
290
291
292
293
294
295
296
 
1625
1626
1627
1628
 
1629
1630
1631
 
158
159
160
 
 
 
 
161
162
163
 
209
210
211
 
 
 
 
212
213
214
 
279
280
281
 
 
 
 
282
283
284
 
1613
1614
1615
 
1616
1617
1618
1619
@@ -158,10 +158,6 @@
  func=self.toggle_show_filterbar, check=self.show_filterbar),   ] + mq_item + [   dict(text='----'), - dict(text=_('Other Parent'), name='other-parent', - ascheck=True, check=False, sensitive=False, - func=self.parent_toggled), - dict(text='----'),   dict(text=_('Refresh'), func=refresh, args=[False],   icon=gtk.STOCK_REFRESH),   dict(text=_('Reset Marks'), func=refresh, args=[True], @@ -213,10 +209,6 @@
  ])   ]   - def parent_toggled(self, item): - self.changeview.parent_toggle.set_active(item.get_active()) - self.changeview.parent_toggled(None) -   def synch_clicked(self, toolbutton, data):   def sync_closed(dialog):   self.cmd_set_sensitive('synchronize', True) @@ -287,10 +279,6 @@
  self.lastrevid = self.currevid   self.changeview.opts['rev'] = [str(self.currevid)]   self.changeview.load_details(self.currevid) - btn = self.changeview.parent_toggle - cmd = 'other-parent' - self.cmd_set_sensitive(cmd, btn.get_property('sensitive')) - self.cmd_set_active(cmd, btn.get_active())   return False     def revisions_loaded(self, graphview): @@ -1625,7 +1613,7 @@
  rev = self.currevid   statopts = self.merge_opts(commands.table['^status|st'][1],   ('include', 'exclude', 'git')) - if self.changeview.parent_toggle.get_active(): + if self.changeview.other_parent_checkbutton.get_active():   parent = self.repo[rev].parents()[1].rev()   else:   parent = self.repo[rev].parents()[0].rev()