[PATCH 2 of 4 V2] mergecmd: simplify conditional
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Tue Sep 22 03:53:23 CDT 2015
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1442519092 25200
# Thu Sep 17 12:44:52 2015 -0700
# Node ID 5364330da26eac96bc76e45bc84388506ac58aac
# Parent a2c1596974fc6975f6f6a7e48b8bbb2682e52388
mergecmd: simplify conditional
The previous if test the same thing with 'if repo._activebookmark'. We make the
if/else logic clearer before a bigger refactoring.
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4783,11 +4783,11 @@ def merge(ui, repo, node=None, **opts):
elif len(bmheads) <= 1:
raise util.Abort(_("no matching bookmark to merge - "
"please merge with an explicit rev or bookmark"),
hint=_("run 'hg heads' to see all heads"))
- if not node and not repo._activebookmark:
+ elif not node:
branch = repo[None].branch()
bheads = repo.branchheads(branch)
nbhs = [bh for bh in bheads if not repo[bh].bookmarks()]
if len(nbhs) > 2:
More information about the Mercurial-devel
mailing list