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 compouneded revision column

Changeset a9c8a7d10b44

Parent ead0992db967

by Yuki KODAMA

Changes to 3 files · Browse files at a9c8a7d10b44 Showing diff from parent ead0992db967 Diff from another changeset...

 
396
397
398
 
399
400
401
 
572
573
574
575
 
576
577
578
 
632
633
634
635
 
636
637
638
 
655
656
657
658
 
659
660
661
662
663
 
664
665
666
 
396
397
398
399
400
401
402
 
573
574
575
 
576
577
578
579
 
633
634
635
 
636
637
638
639
 
656
657
658
 
659
660
661
662
663
 
664
665
666
667
@@ -396,6 +396,7 @@
    column('rev', _('Revision Number'))   column('id', _('Changeset ID')) + column('revhex', _('Revision Number/ID'))   column('branch', _('Branch Name'))   column('msg', _('Summary'))   column('user', _('User')) @@ -572,7 +573,7 @@
  self.syncbox.set_property('visible', self.show_syncbar)   self.syncbox.set_no_show_all(True)   - for col in ('rev', 'date', 'id', 'branch', 'utc', 'age', 'tag'): + for col in ('rev', 'date', 'id', 'revhex', 'branch', 'utc', 'age', 'tag'):   if col in self.showcol:   self.graphview.set_property(col+'-column-visible',   self.showcol[col]) @@ -632,7 +633,7 @@
  settings['show-syncbar'] = self.show_syncbar   settings['graphcol'] = self.graphcol   settings['compactgraph'] = self.compactgraph - for col in ('rev', 'date', 'id', 'branch', 'utc', 'age', 'tag'): + for col in ('rev', 'date', 'id', 'revhex', 'branch', 'utc', 'age', 'tag'):   vis = self.graphview.get_property(col+'-column-visible')   settings['glog-vis-'+col] = vis   settings['filter-mode'] = self.filtercombo.get_active() @@ -655,12 +656,12 @@
  self.graphcol = settings.get('graphcol', True)   self.compactgraph = settings.get('compactgraph', False)   self.showcol = {} - for col in ('rev', 'date', 'id', 'branch', 'utc', 'age', 'tag'): + for col in ('rev', 'date', 'id', 'revhex', 'branch', 'utc', 'age', 'tag'):   key = 'glog-vis-'+col   if key in settings:   self.showcol[col] = settings[key]   self.filter_mode = settings.get('filter-mode', 1) - default_co = 'graph rev id branch msg user date utc age tag' + default_co = 'graph rev id revhex branch msg user date utc age tag'   self.column_order = settings.get('column-order', default_co)     def show_toolbar_on_start(self):
 
31
32
33
 
34
35
36
 
105
106
107
 
108
109
110
 
123
124
125
126
 
127
128
129
130
131
132
 
 
 
133
134
135
 
31
32
33
34
35
36
37
 
106
107
108
109
110
111
112
 
125
126
127
 
128
129
130
131
132
133
134
135
136
137
138
139
140
@@ -31,6 +31,7 @@
   BRANCH = 5 # calculated on demand, not cached  HEXID = 6 +REVHEX = 14  LOCALTIME = 7  UTC = 8   @@ -105,6 +106,7 @@
  if index == TAGS: return str   if index == FGCOLOR: return str   if index == AGE: return str + if index == REVHEX: return str     def on_get_iter(self, path):   return path[0] @@ -123,13 +125,16 @@
  return []   if column == WFILE: return path or ''   - if column in (HEXID, BRANCH, LOCALTIME, UTC): + if column in (HEXID, REVHEX, BRANCH, LOCALTIME, UTC):   try:   ctx = self.repo[revid]   except IndexError:   return None   if column == HEXID:   return str(ctx) + if column == REVHEX: + hexid = gtklib.markup(str(ctx), face='monospace') + return '%s: %s' % (revid, hexid)   if column == BRANCH:   return ctx.branch()   if column == LOCALTIME:
 
77
78
79
80
 
81
82
83
 
 
 
 
 
84
85
86
 
424
425
426
 
 
 
 
 
 
 
 
 
 
 
 
427
428
429
 
506
507
508
509
 
510
511
512
 
77
78
79
 
80
81
82
83
84
85
86
87
88
89
90
91
 
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
 
523
524
525
 
526
527
528
529
@@ -77,10 +77,15 @@
  False,   gobject.PARAM_READWRITE),   'id-column-visible': (gobject.TYPE_BOOLEAN, - 'Tags', + 'ID',   'Show revision ID column',   False,   gobject.PARAM_READWRITE), + 'revhex-column-visible': (gobject.TYPE_BOOLEAN, + 'Rev/ID', + 'Show revision number/ID column', + False, + gobject.PARAM_READWRITE),   'branch-column-visible': (gobject.TYPE_BOOLEAN,   'Branch',   'Show branch', @@ -424,6 +429,18 @@
  col.add_attribute(cell, "foreground", treemodel.FGCOLOR)     cell = gtk.CellRendererText() + cell.set_property("width-chars", 22) + cell.set_property("ellipsize", pango.ELLIPSIZE_END) + col = self.tvcolumns['revhex'] = gtk.TreeViewColumn(_('Rev/ID')) + 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.REVHEX) + + cell = gtk.CellRendererText()   cell.set_property("width-chars", 15)   cell.set_property("ellipsize", pango.ELLIPSIZE_END)   col = self.tvcolumns['branch'] = gtk.TreeViewColumn(_('Branch')) @@ -506,7 +523,7 @@
  col.add_attribute(cell, "text", treemodel.TAGS)   col.add_attribute(cell, "foreground", treemodel.FGCOLOR)   - cols = 'graph rev id branch msg user date utc age tag' + cols = 'graph rev id revhex branch msg user date utc age tag'   self.columns = cols.split()     # append columns