Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

history: add change indicator column

Changeset 8d38b6a39eb9

Parent e9f1f2d33007

by Yuki KODAMA

Changes to 3 files · Browse files at 8d38b6a39eb9 Showing diff from parent e9f1f2d33007 Diff from another changeset...

 
400
401
402
 
403
404
405
 
400
401
402
403
404
405
406
@@ -400,6 +400,7 @@
  column('id', _('Changeset ID'))   column('revhex', _('Revision Number/ID'))   column('branch', _('Branch Name')) + column('changes', _('Changes'))   column('msg', _('Summary'))   column('user', _('User'))   column('date', _('Local Date'))
 
31
32
33
34
35
36
 
 
 
37
38
39
40
41
42
 
 
 
 
 
 
43
44
45
 
98
99
100
 
101
102
103
 
106
107
108
109
 
110
111
112
 
224
225
226
227
 
 
 
 
 
 
 
 
 
 
 
228
229
230
231
232
233
 
234
235
236
 
31
32
33
 
 
 
34
35
36
37
 
 
 
 
 
38
39
40
41
42
43
44
45
46
 
99
100
101
102
103
104
105
 
108
109
110
 
111
112
113
114
 
226
227
228
 
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
 
245
246
247
248
@@ -31,15 +31,16 @@
   BRANCH = 5 # calculated on demand, not cached  HEXID = 6 -REVHEX = 14 -LOCALTIME = 7 -UTC = 8 +REVHEX = 7 +LOCALTIME = 8 +UTC = 9   -MESSAGE = 9 # calculated on demand, cached -COMMITER = 10 -TAGS = 11 -FGCOLOR = 12 -AGE = 13 +MESSAGE = 10 # calculated on demand, cached +COMMITER = 11 +TAGS = 12 +FGCOLOR = 13 +AGE = 14 +CHANGES = 15    class TreeModel(gtk.GenericTreeModel):   @@ -98,6 +99,7 @@
    if index == BRANCH: return str   if index == HEXID: return str + if index == REVHEX: return str   if index == LOCALTIME: return str   if index == UTC: return str   @@ -106,7 +108,7 @@
  if index == TAGS: return str   if index == FGCOLOR: return str   if index == AGE: return str - if index == REVHEX: return str + if index == CHANGES: return str     def on_get_iter(self, path):   return path[0] @@ -224,13 +226,23 @@
  # new   status += 2   - revision = (sumstr, author, taglist, color, age, status) + M, A, R = self.repo.status(ctx.parents()[0].node(), ctx.node())[:3] + common = dict(color='black') + M = M and gtklib.markup(' %s ' % len(M), + background='#ffddaa', **common) or '' + A = A and gtklib.markup(' %s ' % len(A), + background='#aaffaa', **common) or '' + R = R and gtklib.markup(' %s ' % len(R), + background='#ffcccc', **common) or '' + changes = ''.join((M, A, R)) + + revision = (sumstr, author, taglist, color, age, changes, status)   self.revisions[revid] = revision   else:   revision = self.revisions[revid]   if column == GRAPHNODE:   column, color = graphnode - return (column, color, revision[5]) + return (column, color, revision[-1])   else:   return revision[column-MESSAGE]  
 
27
28
29
30
 
31
32
33
 
92
93
94
 
 
 
 
 
95
96
97
 
454
455
456
 
 
 
 
 
 
 
 
 
 
457
 
458
459
460
 
27
28
29
 
30
31
32
33
 
92
93
94
95
96
97
98
99
100
101
102
 
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
@@ -27,7 +27,7 @@
 from tortoisehg.hgtk.logview.graphcell import CellRendererGraph  from tortoisehg.hgtk.logview.revgraph import *   -COLS = 'graph rev id revhex branch msg user date utc age tag' +COLS = 'graph rev id revhex branch changes msg user date utc age tag'    class TreeView(gtk.ScrolledWindow):   @@ -92,6 +92,11 @@
  'Show branch',   False,   gobject.PARAM_READWRITE), + 'changes-column-visible': (gobject.TYPE_BOOLEAN, + 'Changes', + 'Show changes column', + False, + gobject.PARAM_READWRITE),   'tag-column-visible': (gobject.TYPE_BOOLEAN,   'Tags',   'Show tag column', @@ -454,7 +459,18 @@
  col.add_attribute(cell, "foreground", treemodel.FGCOLOR)     cell = gtk.CellRendererText() + cell.set_property("width-chars", 10) + cell.set_property("ellipsize", pango.ELLIPSIZE_END) + col = self.tvcolumns['changes'] = gtk.TreeViewColumn(_('Changes')) + col.set_visible(False) + col.set_resizable(True) + col.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) + col.set_fixed_width(cell.get_size(self.treeview)[2]) + col.pack_start(cell, expand=True) + col.add_attribute(cell, "foreground", treemodel.FGCOLOR) + col.add_attribute(cell, "markup", treemodel.CHANGES)   + cell = gtk.CellRendererText()   cell.set_property("width-chars", 80)   cell.set_property("ellipsize", pango.ELLIPSIZE_END)   col = self.tvcolumns['msg'] = gtk.TreeViewColumn(_('Summary'))