Mercurial > hg
comparison mercurial/commands.py @ 26302:5ba3358ebc7f
mergecmd: simplify conditional
The previous if tested the same thing with 'if repo._activebookmark'. We make the
if/else logic clearer before a bigger refactoring.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 17 Sep 2015 12:44:52 -0700 |
parents | 4b685712fa45 |
children | c99b4d6efdd8 |
comparison
equal
deleted
inserted
replaced
26301:3f8c5c284c86 | 26302:5ba3358ebc7f |
---|---|
4783 elif len(bmheads) <= 1: | 4783 elif len(bmheads) <= 1: |
4784 raise util.Abort(_("no matching bookmark to merge - " | 4784 raise util.Abort(_("no matching bookmark to merge - " |
4785 "please merge with an explicit rev or bookmark"), | 4785 "please merge with an explicit rev or bookmark"), |
4786 hint=_("run 'hg heads' to see all heads")) | 4786 hint=_("run 'hg heads' to see all heads")) |
4787 | 4787 |
4788 if not node and not repo._activebookmark: | 4788 elif not node: |
4789 branch = repo[None].branch() | 4789 branch = repo[None].branch() |
4790 bheads = repo.branchheads(branch) | 4790 bheads = repo.branchheads(branch) |
4791 nbhs = [bh for bh in bheads if not repo[bh].bookmarks()] | 4791 nbhs = [bh for bh in bheads if not repo[bh].bookmarks()] |
4792 | 4792 |
4793 if len(nbhs) > 2: | 4793 if len(nbhs) > 2: |