mercurial/localrepo.py
changeset 46311 014ac7a32048
parent 46310 fc2d5c0aed7f
child 46312 28899b6f4480
--- a/mercurial/localrepo.py	Wed Jan 13 23:07:41 2021 +0100
+++ b/mercurial/localrepo.py	Wed Jan 13 23:41:37 2021 +0100
@@ -1048,7 +1048,7 @@
         slow_path = ui.config(
             b'storage', b'revlog.persistent-nodemap.slow-path'
         )
-        if slow_path not in (b'allow', b'warn'):
+        if slow_path not in (b'allow', b'warn', b'abort'):
             default = ui.config_default(
                 b'storage', b'revlog.persistent-nodemap.slow-path'
             )
@@ -1069,12 +1069,15 @@
             b"check `hg help config.format.use-persistent-nodemap` "
             b"for details"
         )
-        if slow_path == b'warn' and not revlog.HAS_FAST_PERSISTENT_NODEMAP:
-            msg = b"warning: " + msg + b'\n'
-            ui.warn(msg)
-            if not ui.quiet:
-                hint = b'(' + hint + b')\n'
-                ui.warn(hint)
+        if not revlog.HAS_FAST_PERSISTENT_NODEMAP:
+            if slow_path == b'warn':
+                msg = b"warning: " + msg + b'\n'
+                ui.warn(msg)
+                if not ui.quiet:
+                    hint = b'(' + hint + b')\n'
+                    ui.warn(hint)
+            if slow_path == b'abort':
+                raise error.Abort(msg, hint=hint)
         options[b'persistent-nodemap'] = True
     if ui.configbool(b'storage', b'revlog.persistent-nodemap.mmap'):
         options[b'persistent-nodemap.mmap'] = True