[Request] [+ ] D11536: dirstate-item: use `any_tracked` instead of `state` to apply patches
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Fri Oct 1 09:42:40 UTC 2021
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D11536
AFFECTED FILES
mercurial/patch.py
CHANGE DETAILS
diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -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):
To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20211001/f771dacb/attachment-0001.html>
More information about the Mercurial-patches
mailing list