# HG changeset patch # User Matt Mackall # Date 1155684621 18000 # Node ID dd032b0f02ac64a88544f6c71b94edfaed852f48 # Parent 834e147842d70f21b5e3881b2a49992707a5efb0 merge: move forgets to the apply stage diff -r 834e147842d7 -r dd032b0f02ac 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")),