Patchwork D11170: amend: use `update_file` instead of `normallookup`

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

Comments

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

REVISION SUMMARY
  This is the newer, more semantic API.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/cmdutil.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2984,7 +2984,9 @@ 
             # would mark them as clean but with uncommitted contents.
             normalfiles = set(wctx.modified() + wctx.added()) & filestoamend
             for f in normalfiles:
-                dirstate.normallookup(f)
+                dirstate.update_file(
+                    f, p1_tracked=True, wc_tracked=True, possibly_dirty=True
+                )
 
             # Update the state of files which were removed in the amend
             # to "removed" in the dirstate.