[PATCH 2 of 4] mergecmd: simplify conditional
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Mon Sep 21 22:16:36 UTC 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 9f0f1c86741d9fbc71e49f55ada02c47b0cec3ca
# Parent 4a5d8f70d71f914b85b415b2dfb7a7448e9137e5
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