changeset 2897:dd032b0f02ac

merge: move forgets to the apply stage
author Matt Mackall <mpm@selenic.com>
date Tue, 15 Aug 2006 18:30:21 -0500
parents 834e147842d7
children db397c38005d
files mercurial/merge.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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")),