Patchwork D11139: mq: use `update_file_p1` instead of `remove` when adjusting dirstate

login
register
mail settings
Submitter phabricator
Date July 19, 2021, 10:43 a.m.
Message ID <differential-rev-PHID-DREV-4ksmvynyamt3ffpl54ze-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49457/
State Superseded
Headers show

Comments

phabricator - July 19, 2021, 10:43 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is the new API.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11139

AFFECTED FILES
  hgext/mq.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -1099,7 +1099,7 @@ 
                         removed.append(f)
                 with repo.dirstate.parentchange():
                     for f in removed:
-                        repo.dirstate.remove(f)
+                        repo.dirstate.update_file_p1(f, p1_tracked=True)
                     for f in merged:
                         repo.dirstate.merge(f)
                     p1 = repo.dirstate.p1()
@@ -2038,7 +2038,7 @@ 
                         for f in list(repo.dirstate.copies()):
                             repo.dirstate.copy(None, f)
                     for f in r:
-                        repo.dirstate.remove(f)
+                        repo.dirstate.update_file_p1(f, p1_tracked=True)
                     # if the patch excludes a modified file, mark that
                     # file with mtime=0 so status can see it.
                     mm = []