# HG changeset patch # User Pierre-Yves David # Date 2022-12-15 01:54:06 # Node ID e2b89b6d4cdd0bbb3c0f81c42c2c75736184d6ab # Parent 5327ae76b7408e259bea8dcf61bcfe98aa69850f dirstate: use `dirstate.change_files` to scope the change in `shelve` This is the way. diff --git a/mercurial/shelve.py b/mercurial/shelve.py --- a/mercurial/shelve.py +++ b/mercurial/shelve.py @@ -607,7 +607,8 @@ def _docreatecmd(ui, repo, pats, opts): activebookmark = _backupactivebookmark(repo) extra = {b'internal': b'shelve'} if includeunknown: - _includeunknownfiles(repo, pats, opts, extra) + with repo.dirstate.changing_files(repo): + _includeunknownfiles(repo, pats, opts, extra) if _iswctxonnewbranch(repo) and not _isbareshelve(pats, opts): # In non-bare shelve we don't store newly created branch