changeset 48099:e0d566f3ffce

dirstate-item: use `any_tracked` instead of `state` to apply patches Differential Revision: https://phab.mercurial-scm.org/D11536
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 29 Sep 2021 15:40:13 +0200
parents ba79d99ec1ae
children 571dd808c6c8
files mercurial/patch.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Wed Sep 29 15:39:33 2021 +0200
+++ b/mercurial/patch.py	Wed Sep 29 15:40:13 2021 +0200
@@ -550,7 +550,9 @@
         self.copied = []
 
     def _checkknown(self, fname):
-        if self.repo.dirstate[fname] == b'?' and self.exists(fname):
+        if not self.repo.dirstate.get_entry(fname).any_tracked and self.exists(
+            fname
+        ):
             raise PatchError(_(b'cannot patch %s: file is not tracked') % fname)
 
     def setfile(self, fname, data, mode, copysource):