merge: move forgets to the apply stage
authorMatt Mackall <mpm@selenic.com>
Tue, 15 Aug 2006 18:30:21 -0500
changeset 2897 dd032b0f02ac
parent 2896 834e147842d7
child 2898 db397c38005d
merge: move forgets to the apply stage
mercurial/merge.py
--- a/mercurial/merge.py	Tue Aug 15 18:12:36 2006 -0500
+++ b/mercurial/merge.py	Tue Aug 15 18:30:21 2006 -0500
@@ -110,6 +110,7 @@
     merge = {}
     get = {}
     remove = []
+    forget = []
 
     # construct a working dir manifest
     mw = m1.copy()
@@ -133,8 +134,8 @@
         # the file, then we need to remove it from the dirstate, to
         # prevent the dirstate from listing the file when it is no
         # longer in the manifest.
-        if not partial and linear_path and f not in m2:
-            repo.dirstate.forget((f,))
+        if linear_path and f not in m2:
+            forget.append(f)
 
     # Compare manifests
     for f, n in mw.iteritems():
@@ -224,6 +225,8 @@
 
     del mw, m1, m2, ma
 
+    ### apply phase
+
     if overwrite:
         for f in merge:
             get[f] = merge[f][:2]
@@ -300,6 +303,7 @@
 
     if not partial:
         repo.dirstate.setparents(p1, p2)
+        repo.dirstate.forget(forget)
 
     if show_stats:
         stats = ((len(get), _("updated")),