changeset 23649:18ab5e5955df

merge: structure 'remote created' code to match table This does duplicate the call to _checkunknownfile(), but it will simplify future patches.
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 19 Nov 2014 11:44:00 -0800
parents 915ac9403e13
children b85c548ab14d
files mercurial/merge.py
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Mon Dec 22 15:48:39 2014 -0800
+++ b/mercurial/merge.py	Wed Nov 19 11:44:00 2014 -0800
@@ -496,15 +496,19 @@
                 #
                 # Checking whether the files are different is expensive, so we
                 # don't do that when we can avoid it.
-                if force and not branchmerge:
+                if not force:
+                    different = _checkunknownfile(repo, wctx, p2, f)
+                    if different:
+                        aborts.append((f, "ud"))
+                    else:
+                        actions[f] = ('g', (fl2,), "remote created")
+                elif not branchmerge:
                     actions[f] = ('g', (fl2,), "remote created")
                 else:
                     different = _checkunknownfile(repo, wctx, p2, f)
-                    if force and branchmerge and different:
+                    if different:
                         actions[f] = ('m', (f, f, None, False, pa.node()),
                                       "remote differs from untracked local")
-                    elif not force and different:
-                        aborts.append((f, 'ud'))
                     else:
                         actions[f] = ('g', (fl2,), "remote created")
             elif n2 != ma[f]: