Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

commit: mark non head parents

Adds the warning text "[not at head revision]" on each parent if it is
not a head. Except when we have a mq patch.

Changeset f25e014e13fe

Parent ef81cce513b7

by Adrian Buehlmann

Changes to one file · Browse files at f25e014e13fe Showing diff from parent ef81cce513b7 Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​commit.py Stacked
 
315
316
317
318
319
320
321
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
322
323
324
325
326
327
328
329
 
 
 
 
 
 
 
 
 
 
 
330
331
332
333
334
335
336
 
315
316
317
 
 
 
 
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
 
 
 
339
340
341
342
343
344
345
346
347
348
349
350
351
 
 
352
353
354
@@ -315,22 +315,40 @@
  return self.vpaned     def update_parent_labels(self): - def setlabel(label, ctx): - s = str(ctx.rev()) + ' (' + str(ctx) + ') ' - s += hglib.toutf(ctx.description().split('\n')[0]) - label.set_markup('<span face="monospace">%s</span>' % s) + def setlabel(label, ctx, ishead): + revision = str(ctx.rev()) + hash = str(ctx) + summary = hglib.toutf(ctx.description().split('\n')[0]) + face = 'monospace' + size = '9000' + format = '<span face="%s" size="%s">%s (%s) </span>' + t = format % (face, size, revision, hash) + if not ishead and not self.mqmode: + format = '<b>[%s]</b> ' + t += format % _('not at head revision') + format = '<span face="%s" size="%s">%s</span>' + t += format % (face, size, summary) + label.set_markup(t) + + def ishead(ctx): return len(ctx.children()) == 0     if self.mqmode:   ctxs = self.repo['.'].parents()   else:   ctxs = self.repo[None].parents() - setlabel(self.parent1_label, ctxs[0]) - if len(ctxs) == 2: - setlabel(self.parent2_label, ctxs[1]) + + ishead0 = ishead(ctxs[0]) + setlabel(self.parent1_label, ctxs[0], ishead0) + + merge = len(ctxs) == 2 + if not merge: + self.parent2_label.hide() + else: + ishead1 = ishead(ctxs[1]) + setlabel(self.parent2_label, ctxs[1], ishead1) +   self.parent2_label.show()   self.parents_frame.set_label(_('Parents')) - else: - self.parent2_label.hide()     def realize_settings(self):   self.vpaned.set_position(self._setting_vpos)