Angel Ezquerra  committed 5ac642f

phases: add phase column to repo widget

The phase column is a text column, showing the phase name for each revision.
If no phase info can be displayed, "draft" is shown by default.

  • Participants
  • Parent commits b1a57d8
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/

     ('UTCTime', _('UTC Time', 'column header')),
     ('Changes', _('Changes', 'column header')),
     ('Converted', _('Converted From', 'column header')),
+    ('Phase', _('Phase', 'column header')),
     _allcolumns = tuple(h[0] for h in COLUMNHEADERS)
     _allcolnames = dict(COLUMNHEADERS)
-    _columns = ('Graph', 'Rev', 'Branch', 'Description', 'Author', 'Age', 'Tags',)
+    _columns = ('Graph', 'Rev', 'Branch', 'Description', 'Author', 'Age', 'Tags', 'Phase',)
     _stretchs = {'Description': 1, }
     _mqtags = ('qbase', 'qtip', 'qparent')
                 return cvt
         return ''
+    def getphase(self, ctx, gnode):
+        if ctx.rev() is None:
+            return ''
+        try:
+            return ctx.phasestr()
+        except:
+            return 'draft'
     _columnmap = {
         'Rev':      getrev,
         'Node':     lambda self, ctx, gnode: str(ctx),
         'UTCTime':  lambda self, ctx, gnode: hglib.utctime(,
         'Changes':  getchanges,
         'Converted': getconv,
+        'Phase':    getphase,