mercurial/merge.py
changeset 3110 40e777bda455
parent 3109 62044d161470
child 3111 5cc62d99b785
--- a/mercurial/merge.py	Sun Sep 17 17:07:44 2006 -0500
+++ b/mercurial/merge.py	Sun Sep 17 17:13:02 2006 -0500
@@ -221,12 +221,11 @@
     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 @@
     # 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 @@
 
     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