Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

status: show diff to both parents, when applicable

Reuse existing header strings from hgtk, for now

Changeset 2733efd91294

Parent 89f77c3ccbf0

by Steve Borho

Changes to one file · Browse files at 2733efd91294 Showing diff from parent 89f77c3ccbf0 Diff from another changeset...

 
21
22
23
24
25
26
27
 
141
142
143
 
 
 
 
 
 
 
144
 
145
146
147
148
149
 
157
158
159
 
160
161
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
163
164
 
21
22
23
 
24
25
26
 
140
141
142
143
144
145
146
147
148
149
150
151
152
 
153
154
155
 
163
164
165
166
167
 
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
@@ -21,7 +21,6 @@
 # working copy browser.    # Technical Debt -# Show diffs to both parents, when applicable  # Show merge status column, when appropriate  # Thread refreshWctx, connect to an external progress bar  # Thread rowSelected, connect to an external progress bar @@ -141,9 +140,16 @@
  self.te.setHtml(text)   return   + if self.isMerge(): + header = _('===== Diff to first parent %d:%s =====\n') % ( + self.wctx.p1().rev(), str(self.wctx.p1())) + header = '<h3>' + header + '</h3></br>' + else: + header = '' +   hu = htmlui.htmlui() + m = cmdutil.matchfiles(self.repo, [wfile])   try: - m = cmdutil.matchfiles(self.repo, [wfile])   try:   for s, l in patch.difflabel(self.wctx.diff, match=m):   hu.write(s, label=l) @@ -157,8 +163,28 @@
  hu.write(s, label=l)   except (IOError, error.RepoError, error.LookupError, util.Abort), e:   self.status_error = str(e) + return   o, e = hu.getdata() - self.te.setHtml(o) + diff = o or _('<em>No change</em>') + if self.isMerge(): + text = header + diff + else: + self.te.setHtml(header + diff) + return + + try: + for s, l in patch.difflabel(self.wctx.diff, self.wctx.p2(), match=m): + hu.write(s, label=l) + except (IOError, error.RepoError, error.LookupError, util.Abort), e: + self.status_error = str(e) + return + text += '</br><h3>' + text += _('===== Diff to second parent %d:%s =====\n') % ( + self.wctx.p2().rev(), str(self.wctx.p2())) + text += '</h3></br>' + o, e = hu.getdata() + diff = o or _('<em>No change</em>') + self.te.setHtml(text + diff)      class WctxFileTree(QTreeView):