Patchwork D11020: context: use `dirstate.set_untracked` in context.forget

login
register
mail settings
Submitter phabricator
Date July 8, 2021, 7:35 a.m.
Message ID <differential-rev-PHID-DREV-ryjxdlctc6mce3deqluf-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49334/
State Superseded
Headers show

Comments

phabricator - July 8, 2021, 7:35 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is the new shinny API.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1711,13 +1711,9 @@ 
             uipath = lambda f: ds.pathto(pathutil.join(prefix, f))
             rejected = []
             for f in files:
-                if f not in ds:
+                if not ds.set_untracked(f):
                     self._repo.ui.warn(_(b"%s not tracked!\n") % uipath(f))
                     rejected.append(f)
-                elif ds[f] != b'a':
-                    ds.remove(f)
-                else:
-                    ds.drop(f)
             return rejected
 
     def copy(self, source, dest):