# HG changeset patch # User Pierre-Yves David # Date 2021-07-07 23:06:46 # Node ID f636dfe83554c18b20ec8fe494f15217a1c78aba # Parent cce51119bfe64a5ad8c0367d5196bf448f8f5577 context: use `dirstate.set_untracked` in `context.forget` This is the new shiny API. Differential Revision: https://phab.mercurial-scm.org/D11020 diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -1711,13 +1711,9 @@ class workingctx(committablectx): 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):