changeset 3110:40e777bda455

merge: remove linear variable
author Matt Mackall <mpm@selenic.com>
date Sun, 17 Sep 2006 17:13:02 -0500
parents 62044d161470
children 5cc62d99b785
files mercurial/merge.py tests/test-merge7.out tests/test-up-local-change.out tests/test-update-reverse.out
diffstat 4 files changed, 15 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- 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
 
--- a/tests/test-merge7.out	Sun Sep 17 17:07:44 2006 -0500
+++ b/tests/test-merge7.out	Sun Sep 17 17:13:02 2006 -0500
@@ -22,7 +22,7 @@
 (run 'hg heads' to see heads, 'hg merge' to merge)
 merge: warning: conflicts during merge
 resolving manifests
- overwrite None branchmerge True partial False linear False
+ overwrite None branchmerge True partial False
  ancestor 451c744aabcc local a070d41e8360 remote faaea63e63a9
  test.txt versions differ, resolve
 merging test.txt
--- a/tests/test-up-local-change.out	Sun Sep 17 17:07:44 2006 -0500
+++ b/tests/test-up-local-change.out	Sun Sep 17 17:13:02 2006 -0500
@@ -15,7 +15,7 @@
 summary:     1
 
 resolving manifests
- overwrite False branchmerge False partial False linear True
+ overwrite False branchmerge False partial False
  ancestor 33aaa84a386b local 802f095af299 remote 33aaa84a386b
  a versions differ, resolve
 remote created b
@@ -31,7 +31,7 @@
 summary:     2
 
 resolving manifests
- overwrite False branchmerge False partial False linear True
+ overwrite False branchmerge False partial False
  ancestor 802f095af299 local 33aaa84a386b remote 33aaa84a386b
 remote deleted b
 removing b
@@ -49,7 +49,7 @@
 summary:     1
 
 resolving manifests
- overwrite False branchmerge False partial False linear True
+ overwrite False branchmerge False partial False
  ancestor 33aaa84a386b local 802f095af299 remote 33aaa84a386b
  a versions differ, resolve
 remote created b
@@ -100,7 +100,7 @@
 abort: outstanding uncommitted changes
 failed
 resolving manifests
- overwrite False branchmerge True partial False linear False
+ overwrite False branchmerge True partial False
  ancestor 802f095af299 local 030602aee63d remote 33aaa84a386b
  a versions differ, resolve
  b versions differ, resolve
--- a/tests/test-update-reverse.out	Sun Sep 17 17:07:44 2006 -0500
+++ b/tests/test-update-reverse.out	Sun Sep 17 17:13:02 2006 -0500
@@ -40,7 +40,7 @@
 side1
 side2
 resolving manifests
- overwrite True branchmerge False partial False linear False
+ overwrite True branchmerge False partial False
  ancestor ded32b0db104 local 221226fb2bd8 remote 537353581d3d
 remote deleted side2, clobbering
 remote deleted side1, clobbering