Mercurial > hg
changeset 3120:1c1e59aac82a
merge: simplify local created logic
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 17 Sep 2006 21:11:26 -0500 |
parents | b1de36a4b4df |
children | 2ef0b3aae186 |
files | mercurial/merge.py tests/test-up-local-change.out |
diffstat | 2 files changed, 4 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/merge.py Sun Sep 17 20:43:06 2006 -0500 +++ b/mercurial/merge.py Sun Sep 17 21:11:26 2006 -0500 @@ -133,10 +133,9 @@ elif fmerge(f) != m1.execf(f): ui.debug(_(" updating permissions for %s\n") % f) action.append((f, "e", m2.execf(f))) - # contents same, check mode bits elif m1.execf(f) != m2.execf(f): - if overwrite or fmerge(f) != m1.execf(f) + if overwrite or fmerge(f) != m1.execf(f): ui.debug(_(" updating permissions for %s\n") % f) action.append((f, "e", m2.execf(f))) del m2[f] @@ -151,17 +150,11 @@ action.append((f, "r")) else: # file is created on branch or in working directory - if overwrite and n[20:] != "u": + if (overwrite and n[20:] != "u") or (backwards and not n[20:]): ui.debug(_("remote deleted %s, clobbering\n") % f) action.append((f, "r")) - elif not n[20:]: # same as parent - if backwards: - ui.debug(_("remote deleted %s\n") % f) - action.append((f, "r")) - else: - ui.debug(_("local modified %s, keeping\n") % f) else: - ui.debug(_("working dir created %s, keeping\n") % f) + ui.debug(_("local created %s, keeping\n") % f) for f, n in m2.iteritems(): if f in ma:
--- a/tests/test-up-local-change.out Sun Sep 17 20:43:06 2006 -0500 +++ b/tests/test-up-local-change.out Sun Sep 17 21:11:26 2006 -0500 @@ -33,7 +33,7 @@ resolving manifests overwrite False branchmerge False partial False ancestor 802f095af299 local 33aaa84a386b remote 33aaa84a386b -remote deleted b +remote deleted b, clobbering removing b 0 files updated, 0 files merged, 1 files removed, 0 files unresolved changeset: 0:33aaa84a386b