Mercurial > public > mercurial-scm > hg
comparison mercurial/revlogutils/nodemap.py @ 44789:6b01799e9db0
nodemap: add a new mode value, "strict"
When "strict" is set, operation will refuse to use the slow path and abort if
they would. This is useful for testing, benchmarking and server operation.
Differential Revision: https://phab.mercurial-scm.org/D8415
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 14 Apr 2020 03:01:52 +0200 |
parents | 6493f0a567c2 |
children | 261e71752d1f |
comparison
equal
deleted
inserted
replaced
44788:6493f0a567c2 | 44789:6b01799e9db0 |
---|---|
146 mode = revlog.opener.options.get(b"exp-persistent-nodemap.mode") | 146 mode = revlog.opener.options.get(b"exp-persistent-nodemap.mode") |
147 if not can_incremental: | 147 if not can_incremental: |
148 msg = _(b"persistent nodemap in strict mode without efficient method") | 148 msg = _(b"persistent nodemap in strict mode without efficient method") |
149 if mode == b'warn': | 149 if mode == b'warn': |
150 tr._report(b"%s\n" % msg) | 150 tr._report(b"%s\n" % msg) |
151 elif mode == b'strict': | |
152 raise error.Abort(msg) | |
151 | 153 |
152 data = None | 154 data = None |
153 # first attemp an incremental update of the data | 155 # first attemp an incremental update of the data |
154 if can_incremental and ondisk_docket is not None: | 156 if can_incremental and ondisk_docket is not None: |
155 target_docket = revlog._nodemap_docket.copy() | 157 target_docket = revlog._nodemap_docket.copy() |