Patchwork [06,of,14] merge: remove redundant unlink after merge

login
register
mail settings
Submitter Mads Kiilerich
Date Jan. 13, 2013, 7:02 p.m.
Message ID <518580772dfda62de0db.1358103761@localhost6.localdomain6>
Download mbox | patch
Permalink /patch/581/
State Superseded
Commit 26627c30735a610f59979a36885b327b25d8dbff
Headers show

Comments

Mads Kiilerich - Jan. 13, 2013, 7:02 p.m.
# HG changeset patch
# User Mads Kiilerich <mads@kiilerich.com>
# Date 1357686093 -3600
# Node ID 518580772dfda62de0db08bff6aa88a5c089a374
# Parent  35114eddec93c76c02f000e2150900ae608a10e3
merge: remove redundant unlink after merge

The early prescan for move/remove and removal of moved files in applyupdates
was introduced with mergestate 368a4ec603cc and rendered this chunk of code
irrelevant.

The impact of the chunk was reduced in 5b3383ea67d2 - but it could have been
removed completely.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -402,11 +402,6 @@  def applyupdates(repo, actions, wctx, mc
                     updated += 1
                 else:
                     merged += 1
-            if (move and repo.dirstate.normalize(fd) != f
-                and os.path.lexists(repo.wjoin(f))):
-                repo.ui.debug("removing %s\n" % f)
-                audit(f)
-                os.unlink(repo.wjoin(f))
         elif m == "g": # get
             flags = a[2]
             repo.ui.note(_("getting %s\n") % f)