changeset 2974:cbb90f4bafb0

merge: eliminate usage of m1 after working manifest creation
author Matt Mackall <mpm@selenic.com>
date Tue, 22 Aug 2006 17:20:09 -0500
parents a31557193f3c
children 31011730f9bd
files mercurial/merge.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Tue Aug 22 17:08:38 2006 -0500
+++ b/mercurial/merge.py	Tue Aug 22 17:20:09 2006 -0500
@@ -120,8 +120,10 @@
     umap = dict.fromkeys(unknown)
 
     for f in added + modified + unknown:
-        mw[f] = ""
+        mw[f] = nullid + "+"
         mw.set(f, util.is_exec(repo.wjoin(f), mw.execf(f)))
+        if f in m1:
+            mw[f] = m1[f] + "+"
 
     for f in deleted + removed:
         if f in mw:
@@ -152,12 +154,12 @@
                 # are both different from the ancestor?
                 if not overwrite and n != a and m2[f] != a:
                     repo.ui.debug(_(" %s versions differ, resolve\n") % f)
-                    merge[f] = (fmerge(f, mw, m2, ma), m1.get(f, nullid), m2[f])
+                    merge[f] = (fmerge(f, mw, m2, ma), n[:20], m2[f])
                     queued = 1
                 # are we clobbering?
                 # is remote's version newer?
                 # or are we going back in time and clean?
-                elif overwrite or m2[f] != a or (backwards and mw[f] == m1[f]):
+                elif overwrite or m2[f] != a or (backwards and not n[20:]):
                     repo.ui.debug(_(" remote %s is newer, get\n") % f)
                     get[f] = (m2.execf(f), m2[f])
                     queued = 1
@@ -194,7 +196,7 @@
             if overwrite and f not in umap:
                 repo.ui.debug(_("remote deleted %s, clobbering\n") % f)
                 remove.append(f)
-            elif n == m1.get(f, nullid): # same as parent
+            elif not n[20:]: # same as parent
                 if backwards:
                     repo.ui.debug(_("remote deleted %s\n") % f)
                     remove.append(f)