Patchwork D8415: nodemap: add a new mode value, "strict"

login
register
mail settings
Submitter phabricator
Date May 7, 2020, 3:34 p.m.
Message ID <b1d2d416ae23fc73df26a4f077c75aca@localhost.localdomain>
Download mbox | patch
Permalink /patch/46270/
State Not Applicable
Headers show

Comments

phabricator - May 7, 2020, 3:34 p.m.
Closed by commit rHG6b01799e9db0: nodemap: add a new mode value, &quot;strict&quot; (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8415?vs=21093&id=21291

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8415/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8415

AFFECTED FILES
  mercurial/revlogutils/nodemap.py
  tests/test-persistent-nodemap.t

CHANGE DETAILS




To: marmoute, #hg-reviewers, Alphare
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-persistent-nodemap.t b/tests/test-persistent-nodemap.t
--- a/tests/test-persistent-nodemap.t
+++ b/tests/test-persistent-nodemap.t
@@ -96,6 +96,17 @@ 
   5001 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ echo foo > foo
   $ hg add foo
+
+#if no-pure no-rust
+
+  $ hg ci -m 'foo' --config "experimental.exp-persistent-nodemap.mode=strict"
+  transaction abort!
+  rollback completed
+  abort: persistent nodemap in strict mode without efficient method
+  [255]
+
+#endif
+
   $ hg ci -m 'foo'
 
 #if no-pure no-rust
diff --git a/mercurial/revlogutils/nodemap.py b/mercurial/revlogutils/nodemap.py
--- a/mercurial/revlogutils/nodemap.py
+++ b/mercurial/revlogutils/nodemap.py
@@ -148,6 +148,8 @@ 
         msg = _(b"persistent nodemap in strict mode without efficient method")
         if mode == b'warn':
             tr._report(b"%s\n" % msg)
+        elif mode == b'strict':
+            raise error.Abort(msg)
 
     data = None
     # first attemp an incremental update of the data