mercurial/narrowspec.py
changeset 50192 6794f927bc48
parent 50188 39256bee2ed9
child 50248 2fbc109fd58a
--- 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)