context: use `dirstate.set_untracked` in `context.forget`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 08 Jul 2021 01:06:46 +0200
changeset 47600 f636dfe83554
parent 47599 cce51119bfe6
child 47601 4dca29b00405
context: use `dirstate.set_untracked` in `context.forget` This is the new shiny API. Differential Revision: https://phab.mercurial-scm.org/D11020
mercurial/context.py
--- a/mercurial/context.py	Thu Jul 08 00:54:40 2021 +0200
+++ b/mercurial/context.py	Thu Jul 08 01:06:46 2021 +0200
@@ -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):