--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -221,12 +221,11 @@ def update(repo, node, branchmerge=False
backwards = (pa == p2)
# is there a linear path from p1 to p2?
- linear = (pa == p1 or pa == p2)
- if branchmerge and linear:
- raise util.Abort(_("there is nothing to merge, just use "
- "'hg update' or look at 'hg heads'"))
-
- if not linear and not (overwrite or branchmerge):
+ if pa == p1 or pa == p2:
+ if branchmerge:
+ raise util.Abort(_("there is nothing to merge, just use "
+ "'hg update' or look at 'hg heads'"))
+ elif not (overwrite or branchmerge):
raise util.Abort(_("update spans branches, use 'hg merge' "
"or 'hg update -C' to lose changes"))
@@ -243,8 +242,8 @@ def update(repo, node, branchmerge=False
# resolve the manifest to determine which files
# we care about merging
repo.ui.note(_("resolving manifests\n"))
- repo.ui.debug(_(" overwrite %s branchmerge %s partial %s linear %s\n") %
- (overwrite, branchmerge, bool(partial), linear))
+ repo.ui.debug(_(" overwrite %s branchmerge %s partial %s\n") %
+ (overwrite, branchmerge, bool(partial)))
repo.ui.debug(_(" ancestor %s local %s remote %s\n") %
(short(p1), short(p2), short(pa)))
@@ -253,14 +252,14 @@ def update(repo, node, branchmerge=False
if not force:
checkunknown(repo, m2, status)
- if linear:
+ if not branchmerge:
action += forgetremoved(m2, status)
action += manifestmerge(repo.ui, m1, m2, ma, overwrite, backwards, partial)
del m1, m2, ma
### apply phase
- if linear or overwrite:
+ if not branchmerge:
# we don't need to do any magic, just jump to the new rev
p1, p2 = p2, nullid