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: fix parent/child widgets when shown a patch

Changeset f1b97b443495

Parent 5463933cd03d

by Yuki KODAMA

Changes to one file · Browse files at f1b97b443495 Showing diff from parent 5463933cd03d Diff from another changeset...

 
454
455
456
457
 
 
 
458
459
460
461
462
463
464
 
465
466
467
 
540
541
542
 
 
 
 
 
 
 
543
544
545
 
546
547
548
 
549
550
551
 
454
455
456
 
457
458
459
460
461
462
463
464
465
 
466
467
468
469
 
542
543
544
545
546
547
548
549
550
551
552
553
 
554
555
556
 
557
558
559
560
@@ -454,14 +454,16 @@
  parents = []   for pctx in pctxs:   highlight = len(pctxs) == 2 and pctx == pctxs[pindex] - branch = pctx.branch() != ctx.branch() and pctx.branch() or None + branch = None + if hasattr(pctx, 'branch') and pctx.branch() != ctx.branch(): + branch = pctx.branch()   parents.append(revline_data(pctx, highlight, branch))   return parents   elif item == 'children':   children = []   for cctx in ctx.children():   branch = None - if cctx.branch() != ctx.branch(): + if hasattr(cctx, 'branch') and cctx.branch() != ctx.branch():   branch = cctx.branch()   children.append(revline_data(cctx, branch=branch))   return children @@ -540,12 +542,19 @@
  box.pack_start(link, False, False)   box.pack_start(text, True, True, 4)   return box + def genwidget(param): + if isinstance(param, basestring): + label = gtk.Label() + label.set_markup(param) + label.set_selectable(True) + return label + return linkwidget(*param)   if item in ('parents', 'children'):   csets = widget.get_data(item) - return [linkwidget(*cset) for cset in csets] + return [genwidget(cset) for cset in csets]   elif item == 'transplant':   cset = widget.get_data(item) - return linkwidget(*cset) + return genwidget(cset)   raise csinfo.UnknownItem(item)     custom = csinfo.custom(data=data_func, label=label_func,