# HG changeset patch # User Pierre-Yves David # Date 1677122904 -3600 # Node ID 6794f927bc48ecd073a5c9c4b1ed545da4491e46 # Parent 99faa396e1869d5bbf670afa19edb9ee84286742 narrow: enforce that narrow spec is written within a transaction diff -r 99faa396e186 -r 6794f927bc48 mercurial/narrowspec.py --- a/mercurial/narrowspec.py Thu Feb 23 04:42:17 2023 +0100 +++ b/mercurial/narrowspec.py Thu Feb 23 04:28:24 2023 +0100 @@ -182,7 +182,8 @@ tr = repo.currenttransaction() if tr is None: - repo.svfs.write(FILENAME, spec) + m = "changing narrow spec outside of a transaction" + raise error.ProgrammingError(m) else: # the roundtrip is sometime different # not taking any chance for now @@ -215,7 +216,8 @@ tr = repo.currenttransaction() spec = format(*repo.narrowpats) if tr is None: - repo.vfs.write(DIRSTATE_FILENAME, spec) + m = "changing narrow spec outside of a transaction" + raise error.ProgrammingError(m) else: reporef = weakref.ref(repo)