Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

stable commit: merge is not a "-1 head" commit if merging branches

For example, when you merge the 'stable' branch to 'default', you are not
removing any branch heads. You are simply adding a 'default' child revision
to the 'stable' head revision.

I also swapped the if/else just because I prefer not to use 'if not foo: else:'

Closes #953

Changeset 989a18e00cdb

Parent 2391025fcf43

by Steve Borho

Changes to one file · Browse files at 989a18e00cdb Showing diff from parent 2391025fcf43 Diff from another changeset...

 
638
639
640
641
642
643
644
645
646
647
 
 
 
648
649
650
651
652
 
 
 
 
 
 
653
654
655
 
638
639
640
 
 
 
 
 
 
 
641
642
643
644
645
646
647
 
648
649
650
651
652
653
654
655
656
@@ -638,18 +638,19 @@
  else:   plus, minus = _('_Commit (+1 head)'), _('_Commit (-1 head)')   ctxs, isheads, ismerge = self.get_head_info() - if not ismerge: - if not isheads[0]: - label = plus - tooltip = _('parent is not a head, ' - 'commit to add a new head') - else: - if isheads[0] and isheads[1]: + if ismerge: + b1, b2 = [c.branch() for c in ctxs] + if isheads[0] and isheads[1] and b1 == b2:   label = minus   tooltip = _('commit to merge one head')   elif not isheads[0] and not isheads[1]:   label = plus - tooltip = _('no parent is a head, ' + tooltip = _('neither parent is a head, ' + 'commit to add a new head') + else: + if not isheads[0]: + label = plus + tooltip = _('parent is not a head, '   'commit to add a new head')     btn = self.get_toolbutton('commit')