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 changeset: fix unexpected showing the second parent

In case of selecting merged changeset successively, the check button
isn't unchecked and diff pane always shows second parent.
Before showing merged changeset, it always clear the cache of csinfo,
not only toggled 'Diff to second Parent' check button.

Changeset de8632f5205a

Parent 8d0c31ee98df

by Yuki KODAMA

Changes to one file · Browse files at de8632f5205a Showing diff from parent 8d0c31ee98df Diff from another changeset...

 
42
43
44
45
46
47
48
 
81
82
83
 
84
85
86
 
88
89
90
 
91
92
93
94
95
96
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
99
 
 
100
101
102
103
104
105
106
107
 
 
 
 
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
 
42
43
44
 
45
46
47
 
80
81
82
83
84
85
86
 
88
89
90
91
92
93
94
 
 
 
 
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
 
114
115
116
 
 
 
 
 
 
 
117
118
119
120
121
122
123
124
 
 
 
 
 
 
 
 
125
126
127
@@ -42,7 +42,6 @@
  return []     def parent_toggled(self, button): - self.clear_cache()   self.load_details(self.currev)     def prepare_display(self): @@ -81,6 +80,7 @@
    def load_details(self, rev):   'Load selected changeset details into buffer and filelist' + oldrev = hasattr(self, 'currev') and self.currev or None   self.currev = rev   ctx = self.repo[rev]   if not ctx: @@ -88,35 +88,40 @@
    if not self.parent_button.parent:   self.parent_box.pack_start(self.parent_button, False, False) + self.parent_button.show_all()     parents = ctx.parents()   title = self.get_title() - if len(parents) == 2: - self.parent_box.show_all() - if self.diff_other_parent(): - title += ':' + str(parents[1].rev()) + if parents: + if len(parents) == 2: + self.parent_box.show() + if self.diff_other_parent(): + title += ':' + str(parents[1].rev()) + parent = parents[1].node() + else: + title += ':' + str(parents[0].rev()) + parent = parents[0].node() + if rev != oldrev: + # uncheck the check button + self.parent_button.handler_block_by_func( + self.parent_toggled) + self.parent_button.set_active(False) + self.parent_button.handler_unblock_by_func( + self.parent_toggled) + # clear cache for highlighting parent correctly + self.clear_cache()   else: - title += ':' + str(parents[0].rev()) + self.parent_box.hide() + parent = parents[0].node()   else: - self.parent_box.hide_all() - if self.parent_button.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_button.set_active(False) - return + parent = self.repo[-1] + + # update dialog title + self.set_title(title)     if self.clipboard:   self.clipboard.set_text(str(ctx))   - self.set_title(title) - if self.diff_other_parent(): - parent = parents[1].node() - elif parents: - parent = parents[0].node() - else: - parent = self.repo[-1] -   pats = self.pats   if self.graphview:   (path, focus) = self.graphview.treeview.get_cursor()