Mercurial > hg-stable
changeset 8737:a1808b40a8fb
merge: reorder get cases for future simplification
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 08 Jun 2009 18:14:44 -0500 |
parents | 7619b16ea880 |
children | 8a9899a6327e |
files | mercurial/merge.py |
diffstat | 1 files changed, 10 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- 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)