changeset 2981:1b738357bba9

merge: fold umap and added into m1 manifest
author Matt Mackall <mpm@selenic.com>
date Tue, 22 Aug 2006 21:02:25 -0500
parents 54d85098fb82
children fe9b13e35e46 87ea5a71f7b9
files mercurial/merge.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Tue Aug 22 19:39:54 2006 -0500
+++ b/mercurial/merge.py	Tue Aug 22 21:02:25 2006 -0500
@@ -113,9 +113,10 @@
     # update m1 from working dir
     umap = dict.fromkeys(unknown)
 
-    for f in added + modified + unknown:
-        m1[f] = m1.get(f, nullid) + "+"
-        m1.set(f, util.is_exec(repo.wjoin(f), m1.execf(f)))
+    for i,l in (("a", added), ("m", modified), ("u", unknown)):
+        for f in l:
+            m1[f] = m1.get(f, nullid) + i
+            m1.set(f, util.is_exec(repo.wjoin(f), m1.execf(f)))
 
     for f in deleted + removed:
         del m1[f]
@@ -154,7 +155,7 @@
                     repo.ui.debug(_(" remote %s is newer, get\n") % f)
                     action[f] = (m2.execf(f), m2[f], None)
                     queued = 1
-            elif f in umap or f in added:
+            elif n[20:] in ("u","a"):
                 # this unknown file is the same as the checkout
                 # we need to reset the dirstate if the file was added
                 action[f] = (m2.execf(f), m2[f], None)
@@ -184,7 +185,7 @@
                 action[f] = (None, None, None)
         else:
             # file is created on branch or in working directory
-            if overwrite and f not in umap:
+            if overwrite and n[20:] != "u":
                 repo.ui.debug(_("remote deleted %s, clobbering\n") % f)
                 action[f] = (None, None, None)
             elif not n[20:]: # same as parent