Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.1, 1.1.1, and 1.1.2

thgpbranch: Show pending merge as patch status

Changeset 4b9707978ad5

Parent d5785c1518ea

by Peer Sommerlund

Changes to one file · Browse files at 4b9707978ad5 Showing diff from parent d5785c1518ea Diff from another changeset...

 
21
22
23
 
24
25
26
27
 
 
28
29
30
 
34
35
36
 
 
 
 
 
37
38
39
 
115
116
117
118
 
 
119
120
121
 
162
163
164
 
165
166
167
 
200
201
202
 
 
 
203
204
205
206
207
208
 
209
210
 
 
211
212
 
213
214
215
 
217
218
219
220
 
221
222
223
224
225
226
 
227
 
 
228
229
 
230
231
232
 
 
233
234
235
236
237
238
239
 
 
 
240
241
 
242
243
244
245
 
246
247
248
 
478
479
480
 
481
482
483
 
537
538
539
 
 
540
541
542
 
21
22
23
24
25
26
27
 
28
29
30
31
32
 
36
37
38
39
40
41
42
43
44
45
46
 
122
123
124
 
125
126
127
128
129
 
170
171
172
173
174
175
176
 
209
210
211
212
213
214
215
216
217
218
219
 
220
221
 
222
223
224
 
225
226
227
228
 
230
231
232
 
233
234
235
236
237
238
 
239
240
241
242
243
 
244
245
 
 
246
247
248
249
250
251
 
 
 
252
253
254
255
 
256
257
258
259
 
260
261
262
263
 
493
494
495
496
497
498
499
 
553
554
555
556
557
558
559
560
@@ -21,10 +21,12 @@
 M_IN_LINES = 1  M_OUT_LINES = 2  M_NAME = 3 +M_STATUS = 4    # Patch Branch column enumeration  C_GRAPH = 0 -C_NAME = 1 +C_STATUS = 1 +C_NAME = 2    class PBranchWidget(gtk.VBox):   @@ -34,6 +36,11 @@
  'Show graph column',   False,   gobject.PARAM_READWRITE), + 'status-column-visible': (gobject.TYPE_BOOLEAN, + 'Status', + 'Show status column', + False, + gobject.PARAM_READWRITE),   'name-column-visible': (gobject.TYPE_BOOLEAN,   'Name',   'Show name column', @@ -115,7 +122,8 @@
  gobject.TYPE_PYOBJECT, # node info   gobject.TYPE_PYOBJECT, # in-lines   gobject.TYPE_PYOBJECT, # out-lines - str) # patch name + str, # patch name + str) # patch status   #### patch list view   self.list = gtk.TreeView(self.model)   self.list.connect('button-press-event', self.list_pressed) @@ -162,6 +170,7 @@
  ("in-lines",M_IN_LINES),   ("out-lines", M_OUT_LINES)]   ) + addcol(_('St'), C_STATUS, M_STATUS)   addcol(_('Name'), C_NAME, M_NAME, editfunc=cell_edited)     pane.add(self.list) @@ -200,16 +209,20 @@
  if patch_list:   dep_list = [patch_list[0]]   cur_branch = self.repo['.'].branch() + patch_status = {} + for name in patch_list: + patch_status[name] = self.pstatus(name)   for name in patch_list:   parents = graph.deps(name)     # Node properties   if name in dep_list: - node_col = dep_list.index(name) + node_column = dep_list.index(name)   else: - node_col = len(dep_list) + node_column = len(dep_list) + node_colour = patch_status[name] and '#ff0000' or 0   node_status = (name == cur_branch) and 4 or 0 - node = (node_col,0,node_status) # (column, colour, status) tuple to draw revision node, + node = (node_column, node_colour, node_status)     # Find next dependency list   my_deps = [] @@ -217,32 +230,34 @@
  if p not in dep_list:   my_deps.append(p)   next_dep_list = dep_list[:] - next_dep_list[node_col:node_col+1] = my_deps + next_dep_list[node_column:node_column+1] = my_deps     # Dependency lines   shift = len(parents) - 1   out_lines = []   for p in parents: - dep_col = next_dep_list.index(p) + dep_column = next_dep_list.index(p)   colour = 0 # black + if patch_status[p]: + colour = '#ff0000' # red   style = 0 # solid lines - out_lines.append((node_col, dep_col, colour, style)) + out_lines.append((node_column, dep_column, colour, style))   for lines in in_lines: - (start, end, colour, style) = lines - if end == node_col: + (start_column, end_column, colour, style) = lines + if end_column == node_column:   # Deps to current patch end here   pass   else:   # Find line continuations - dep = dep_list[end] - dep_col = next_dep_list.index(dep) - out_lines.append((end, dep_col, colour, style)) + dep = dep_list[end_column] + dep_column = next_dep_list.index(dep) + out_lines.append((end_column, dep_column, colour, style))   - stat = '?' # patch status + stat = patch_status[name] and 'M' or 'C' # patch status   patchname = name   msg = '%s' % parents # summary (utf-8)   msg_esc = 'what-is-this-for' # escaped summary (utf-8) - self.model.append((node, in_lines, out_lines, patchname)) + self.model.append((node, in_lines, out_lines, patchname, stat))   # Loop   in_lines = out_lines   dep_list = next_dep_list @@ -478,6 +493,7 @@
  self.vmenu = {}     colappend(_('Show graph'), C_GRAPH) + colappend(_('Show status'), C_STATUS, active=False)   colappend(_('Show name'), C_NAME)     append(sep=True) @@ -537,6 +553,8 @@
  def col_to_prop(self, col_idx):   if col_idx == C_GRAPH:   return 'graph-column-visible' + if col_idx == C_STATUS: + return 'status-column-visible'   if col_idx == C_NAME:   return 'name-column-visible'   return ''