diff tests/test-topic-issue6500.t @ 6023:6c67219ce779 stable

topic: don't cache topic of e.g. memctx in _topiccache (issue6500) _topiccache exists to make us hit the storage less often when we want to look at topics for any reason. It doesn't make much sense to cache something that is memory-only and is cheap to access however. Caching things like that was also a source of a bug where creating multiple memctx instances in one process would cache topic of the first one and ignore actual content of .extra() of the others. That was happening because the cache is keyed by .rev(), but all memctx instances have the same .rev() = None.
author Anton Shestakov <av6@dwimlabs.net>
date Sun, 29 Aug 2021 14:41:23 +0300
parents 43bde39bbe65
children
line wrap: on
line diff
--- a/tests/test-topic-issue6500.t	Sun Aug 29 14:30:37 2021 +0300
+++ b/tests/test-topic-issue6500.t	Sun Aug 29 14:41:23 2021 +0300
@@ -32,14 +32,13 @@
   1: amend_source=* branch=default topic=foo (glob)
   2: amend_source=* branch=default (glob)
 
-TODO: creating and handling 2 memctx instances (based on 1 and then 2) should work
+creating and handling 2 memctx instances (based on 1 and then 2) should work
 
-  $ hg touch --hidden -r 1+2 --duplicate 2>&1 | tail -2
-      del ctx.extra()[constants.extrakey]
-  KeyError: b'topic'
+  $ hg touch --hidden -r 1+2 --duplicate
+  switching to topic foo
 
-TODO: make sure extras stay the same
+make sure extras stay the same
 
   $ hg log --hidden -r 3+4 -T '{rev}: {join(extras, " ")}\n'
-  abort: unknown revision '3' (glob)
-  [255]
+  3: __touch-noise__=* amend_source=* branch=default topic=foo (glob)
+  4: __touch-noise__=* amend_source=* branch=default (glob)