merge: reorder get cases for future simplification
authorMatt Mackall <mpm@selenic.com>
Mon, 08 Jun 2009 18:14:44 -0500
changeset 8737 a1808b40a8fb
parent 8736 7619b16ea880
child 8738 8a9899a6327e
merge: reorder get cases for future simplification
mercurial/merge.py
--- a/mercurial/merge.py	Mon Jun 08 18:14:44 2009 -0500
+++ b/mercurial/merge.py	Mon Jun 08 18:14:44 2009 -0500
@@ -178,19 +178,20 @@
             # are files different?
             if n != m2[f]:
                 a = ma.get(f, nullid)
-                # are we clobbering?
-                if overwrite:
-                    act("clobbering", "g", f, rflags)
-                # or are we going back in time and clean?
-                elif backwards:
-                    if not n[20:] or not p2[f].cmp(p1[f].data()):
-                        act("reverting", "g", f, rflags)
                 # are both different from the ancestor?
-                elif n != a and m2[f] != a:
+                if n != a and m2[f] != a:
                     act("versions differ", "m", f, f, f, rflags, False)
                 # is remote's version newer?
                 elif m2[f] != a:
-                    act("remote is newer", "g", f, rflags)
+                    # are we clobbering?
+                    if overwrite:
+                        act("clobbering", "g", f, rflags)
+                    # or are we going back in time and clean?
+                    elif backwards:
+                        if not n[20:] or not p2[f].cmp(p1[f].data()):
+                            act("reverting", "g", f, rflags)
+                    else:
+                        act("remote is newer", "g", f, rflags)
                 # local is newer, not overwrite, check mode bits
                 elif m1.flags(f) != rflags:
                     act("update permissions", "e", f, rflags)