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

stable changeset: show parent/child branch if they differ from current

This feature was forgotten when the changeset field was rewritten to the new
version.

Changeset 16086ce83e75

Parent 61ffede30d05

by Henrik Stuart

Changes to one file · Browse files at 16086ce83e75 Showing diff from parent 61ffede30d05 Diff from another changeset...

 
438
439
440
441
 
442
443
444
445
 
446
447
448
 
454
455
456
457
 
 
458
459
460
 
 
 
 
 
 
 
461
462
463
 
484
485
486
487
 
488
489
490
491
 
 
492
493
 
 
494
495
496
 
506
507
508
509
 
510
511
512
513
514
 
 
 
 
 
 
 
 
515
516
517
 
438
439
440
 
441
442
443
444
 
445
446
447
448
 
454
455
456
 
457
458
459
460
 
461
462
463
464
465
466
467
468
469
470
 
491
492
493
 
494
495
496
497
498
499
500
501
502
503
504
505
506
507
 
517
518
519
 
520
521
522
523
 
 
524
525
526
527
528
529
530
531
532
533
534
@@ -438,11 +438,11 @@
  def summary_line(desc):   desc = desc.replace('\0', '')   return hglib.toutf(desc.split('\n')[0][:80]) - def revline_data(ctx, hl=False): + def revline_data(ctx, hl=False, branch=None):   if isinstance(ctx, basestring):   return ctx   desc = ctx.description() - return (str(ctx.rev()), str(ctx), summary_line(desc), hl) + return (str(ctx.rev()), str(ctx), summary_line(desc), hl, branch)   if item == 'cset':   return revline_data(ctx)   elif item == 'branch': @@ -454,10 +454,17 @@
  parents = []   for pctx in pctxs:   highlight = len(pctxs) == 2 and pctx == pctxs[pindex] - parents.append(revline_data(pctx, highlight)) + branch = pctx.branch() != ctx.branch() and pctx.branch() or None + parents.append(revline_data(pctx, highlight, branch))   return parents   elif item == 'children': - return [revline_data(ctx) for ctx in ctx.children()] + children = [] + for cctx in ctx.children(): + branch = None + if cctx.branch() != ctx.branch(): + branch = cctx.branch() + children.append(revline_data(cctx, branch=branch)) + return children   elif item == 'transplant':   ts = widget.get_data('transplant', usepreset=True)   if not ts: @@ -484,13 +491,17 @@
  return _('Patch:')   raise csinfo.UnknownItem(item)   def markup_func(widget, item, value): - def revline_markup(revnum, revid, summary, highlight=None): + def revline_markup(revnum, revid, summary, highlight=None, branch=None):   revnum = gtklib.markup(revnum)   summary = gtklib.markup(summary)   if revid:   revid = revid_markup(revid) + if branch: + return '%s (%s) [%s] %s' % (revnum, revid, branch, summary)   return '%s (%s) %s' % (revnum, revid, summary)   else: + if branch: + return '%s [%s] - %s' % (revnum, branch, summary)   return '%s - %s' % (revnum, summary)   if item in ('cset', 'transplant', 'patch'):   if isinstance(value, basestring): @@ -506,12 +517,18 @@
  return csets   raise csinfo.UnknownItem(item)   def widget_func(widget, item, markups): - def linkwidget(revnum, revid, summary, highlight=None): + def linkwidget(revnum, revid, summary, highlight=None, branch=None):   opts = dict(underline='single', foreground='#0000FF')   if highlight:   opts['weight'] = 'bold' - rev = '%s (%s)' % (gtklib.markup(revnum, **opts), - revid_markup(revid, **opts)) + revfmt = '%s (%s)' + revargs = [gtklib.markup(revnum, **opts), + revid_markup(revid, **opts)] + if branch: + revfmt = '%s (%s) [%s]' + revargs.append(branch) + + rev = revfmt % tuple(revargs)   link = gtk.Label()   link.set_markup(rev)   link.set_selectable(True)