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

repomodel: add Node column

Changeset 97cb9c42da42

Parent de0fb703cc70

by David Wilhelm

Changes to one file · Browse files at 97cb9c42da42 Showing diff from parent de0fb703cc70 Diff from another changeset...

 
14
15
16
17
 
18
19
20
 
36
37
38
39
 
 
40
41
42
 
77
78
79
 
80
81
82
 
112
113
114
115
 
 
116
117
118
 
257
258
259
 
 
260
261
262
 
14
15
16
 
17
18
19
20
 
36
37
38
 
39
40
41
42
43
 
78
79
80
81
82
83
84
 
114
115
116
 
117
118
119
120
121
 
260
261
262
263
264
265
266
267
@@ -14,7 +14,7 @@
 # this program; if not, write to the Free Software Foundation, Inc.,  # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.   -from mercurial import util, error +from mercurial import util, error, node    from tortoisehg.util.hglib import tounicode, username  from tortoisehg.hgqt.graph import Graph @@ -36,7 +36,8 @@
  "darkcyan", "gray", "yellow", ]  COLORS = [str(QColor(x).name()) for x in COLORS]  #COLORS = [str(color) for color in QColor.colorNames()] -ALLCOLUMNS = ('ID', 'Branch', 'Graph', 'Log', 'Author', 'Date', 'Tags',) +ALLCOLUMNS = ('ID', 'Node', 'Branch', 'Graph', 'Log', 'Author', 'Date', + 'Tags',)    def get_color(n, ignore=()):   """ @@ -77,6 +78,7 @@
   # XXX maybe it's time to make these methods of the model...  _columnmap = {'ID': lambda ctx, gnode: ctx.rev() is not None and str(ctx.rev()) or "", + 'Node': lambda ctx, gnode: str(ctx),   'Graph': lambda ctx, gnode: "",   'Log': getlog,   'Author': lambda ctx, gnode: username(ctx.user()), @@ -112,7 +114,8 @@
  """   Model used for displaying the revisions of a Hg *local* repository   """ - _columns = ('Graph', 'ID', 'Branch', 'Log', 'Author', 'Date', 'Tags',) + _columns = ('Graph', 'ID', 'Node', 'Branch', 'Log', 'Author', 'Date', + 'Tags',)   _stretchs = {'Log': 1, }     def __init__(self, repo, branch='', parent=None): @@ -257,6 +260,8 @@
  column = self._columns[col]   if column == 'ID':   return str(len(self.repo)) + if column == 'Node': + return node.short(node.nullid)   if column == 'Date':   return cvrt_date(self.repo[None].date())   if column == 'Tags':