Mercurial > evolve
changeset 5862:5056fb0c919e stable
evolve: use nullrev for an empty cache key
Pairing nullid with nullrev (-1) seems more logical than pairing it with 0.
This also means we don't false-detect strips out of nowhere. That used to
happen because newkey (-1, nullid) != self._cachekey (0, nullid).
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Wed, 24 Mar 2021 22:07:07 +0800 |
parents | bf8a61f1c616 |
children | 34c7661bd5e2 |
files | hgext3rd/evolve/genericcaches.py tests/test-discovery-obshashrange.t |
diffstat | 2 files changed, 1 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext3rd/evolve/genericcaches.py Wed Mar 17 20:19:41 2021 +0800 +++ b/hgext3rd/evolve/genericcaches.py Wed Mar 24 22:07:07 2021 +0800 @@ -143,7 +143,7 @@ __metaclass__ = abc.ABCMeta # default key used for an empty cache - emptykey = (0, node.nullid) + emptykey = (node.nullrev, node.nullid) _cachekeyspec = b'i20s' _cachename = None # used for debug message
--- a/tests/test-discovery-obshashrange.t Wed Mar 17 20:19:41 2021 +0800 +++ b/tests/test-discovery-obshashrange.t Wed Mar 24 22:07:07 2021 +0800 @@ -134,14 +134,10 @@ (run 'hg update' to get a working copy) $ hg -R ../server blackbox * @0000000000000000000000000000000000000000 (*)> debugobshashrange --subranges --rev tip (glob) - * @0000000000000000000000000000000000000000 (*)> strip detected, evo-ext-stablerange-mergepoint cache reset (glob) - * @0000000000000000000000000000000000000000 (*)> strip detected, evo-ext-depthcache cache reset (glob) * @0000000000000000000000000000000000000000 (*)> updated evo-ext-depthcache in *.???? seconds (8r) (glob) * @0000000000000000000000000000000000000000 (*)> updated evo-ext-stablerange-mergepoint in *.???? seconds (8r) (glob) 1970/01/01 00:00:00 * @0000000000000000000000000000000000000000 (*)> updated evo-ext-obshashrange in *.???? seconds (8r, 5o) (glob) - 1970/01/01 00:00:00 * @0000000000000000000000000000000000000000 (*)> strip detected, evo-ext-stablesort cache reset (glob) 1970/01/01 00:00:00 * @0000000000000000000000000000000000000000 (*)> updated evo-ext-stablesort in *.???? seconds (8r) (glob) - 1970/01/01 00:00:00 * @0000000000000000000000000000000000000000 (*)> strip detected, evo-ext-firstmerge cache reset (glob) 1970/01/01 00:00:00 * @0000000000000000000000000000000000000000 (*)> updated evo-ext-firstmerge in *.???? seconds (8r) (glob) * @0000000000000000000000000000000000000000 (*)> debugobshashrange --subranges --rev tip exited 0 after *.?? seconds (glob) * @0000000000000000000000000000000000000000 (*)> -R server serve --stdio (glob) @@ -154,14 +150,6 @@ cccccccccccccccccccccccccccccccccccccccc bebd167eb94d257ace0e814aeb98e6972ed2970d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ rm ../server/.hg/blackbox.log $ hg blackbox - * @0000000000000000000000000000000000000000 (*)> strip detected, evo-ext-firstmerge cache reset (glob) - * @0000000000000000000000000000000000000000 (*)> updated evo-ext-firstmerge in *.???? seconds (0r) (glob) - * @0000000000000000000000000000000000000000 (*)> strip detected, evo-ext-depthcache cache reset (glob) - * @0000000000000000000000000000000000000000 (*)> updated evo-ext-depthcache in *.???? seconds (0r) (glob) - * @0000000000000000000000000000000000000000 (*)> strip detected, evo-ext-stablesort cache reset (glob) - * @0000000000000000000000000000000000000000 (*)> updated evo-ext-stablesort in *.???? seconds (0r) (glob) - * @0000000000000000000000000000000000000000 (*)> strip detected, evo-ext-stablerange-mergepoint cache reset (glob) - * @0000000000000000000000000000000000000000 (*)> updated evo-ext-stablerange-mergepoint in *.???? seconds (0r) (glob) * @0000000000000000000000000000000000000000 (*)> 0/0 cache hits/lookups in *.???? seconds (glob) * @0000000000000000000000000000000000000000 (*)> clone *ssh://user@dummy/server* client exited 0 after *.?? seconds (glob) * @0000000000000000000000000000000000000000 (*)> pull --rev 4 (glob) @@ -334,7 +322,6 @@ * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> preparing listkeys for "namespaces" (glob) * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> sending listkeys command (glob) * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> received listkey for "namespaces": 40 bytes (glob) - * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> strip detected, evo-ext-stablerange-mergepoint cache reset (glob) * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-depthcache in *.???? seconds (6r) (glob) * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-stablerange-mergepoint in *.???? seconds (6r) (glob) 1970/01/01 00:00:00 * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-obshashrange in *.???? seconds (6r, 4o) (glob) @@ -1068,7 +1055,6 @@ * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> writing .hg/cache/tags2-visible with 0 tags (glob) * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> log -G exited 0 after *.?? seconds (glob) * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> pull (glob) - * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> strip detected, evo-ext-stablerange-mergepoint cache reset (glob) * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> strip detected, evo-ext-depthcache cache reset (glob) * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated evo-ext-depthcache in *.???? seconds (8r) (glob) * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated evo-ext-stablerange-mergepoint in *.???? seconds (8r) (glob)