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

repomodel: render MQ patch tags in blue

Changeset c85bb3b74b44

Parent 8ee3b7de9099

by George Marrows

Changes to 2 files · Browse files at c85bb3b74b44 Showing diff from parent 8ee3b7de9099 Diff from another changeset...

 
94
95
96
97
98
99
100
 
133
134
135
136
137
138
 
139
140
141
 
431
432
433
434
435
 
436
437
438
 
442
443
444
445
 
 
 
 
 
446
447
448
 
94
95
96
 
97
98
99
 
132
133
134
 
 
 
135
136
137
138
 
428
429
430
 
 
431
432
433
434
 
438
439
440
 
441
442
443
444
445
446
447
448
@@ -94,7 +94,6 @@
  """   QAbstractTableModel.__init__(self, parent)   self.datacache = {} - self.hasmq = False   self.mqueues = []   self.wd_revs = []   self.graph = None @@ -133,9 +132,7 @@
  # might occur if reloading during a mq operation (or   # whatever operation playing with hg history)   return - self.hasmq = hasattr(self.repo, "mq") - if self.hasmq: - self.mqueues = self.repo.mq.series[:] + self.mqueues = hglib.getmqpatchtags(self.repo)   self.wd_revs = [ctx.rev() for ctx in wdctxs]   grapher = revision_grapher(self.repo, start_rev=None,   follow=False, branch=branch) @@ -431,8 +428,7 @@
  return hglib.tounicode(",".join(tags))     def getlog(self, ctx, gnode): - # TODO: add branch name / bookmark / patches / - # wd parent markups + # TODO: add branch name / bookmark / wd parent markups   if ctx.rev() is None:   return '** ' + _('Working copy changes') + ' **'   @@ -442,7 +438,11 @@
    tstr = ''   for tag in (hglib.getctxtags(ctx) or []): - style = {'fg': "black", 'bg': '#ffffaa'} + bg = '#ffffaa' + if tag in self.mqueues: + bg = '#aaddff' + style = {'fg': "black", 'bg': bg} +   tstr += qtlib.markup(' %s ' % tag, **style) + ' '     return tstr + msg
 
191
192
193
 
 
 
 
 
 
 
194
195
196
 
191
192
193
194
195
196
197
198
199
200
201
202
203
@@ -191,6 +191,13 @@
  return tags   return None   +def getmqpatchtags(repo): + '''Returns all tag names used by MQ patches, or []''' + if hasattr(repo, 'mq'): + repo.mq.parse_series() + return repo.mq.series[:] + else: + return []    def diffexpand(line):   'Expand tabs in a line of diff/patch text'