Mercurial > hg-stable
diff tests/test-branches-obsolete.t @ 51578:718f28ea3af4
branchcache: add a "pure topological head" fast path
In a narrow but actually quick common case, all topological heads are all on
the same branch and all open. In this case, computing the branch map is very
simple. We can quickly detect situation where this situation will not change.
So we update the V3 format to be able to express this situation and upgrade the
update code to detect we remains in that mode.
The branch cache is populated with the actual value when the branch map is
accessed, but the update_disk method can do the update without needing to
populate it.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 07 Mar 2024 04:15:23 +0100 |
parents | f85f23f1479b |
children | f02ec1ecb3bf |
line wrap: on
line diff
--- a/tests/test-branches-obsolete.t Wed Mar 06 16:18:03 2024 +0100 +++ b/tests/test-branches-obsolete.t Thu Mar 07 04:15:23 2024 +0100 @@ -113,6 +113,19 @@ | o root + +#if v2 + $ show_cache + ##### .hg/cache/branch2-served + 3d808bbc94408ea19da905596d4079357a1f28be 8 + 63ba7cd843d1e95aac1a24435befeb1909c53619 o default + 3d808bbc94408ea19da905596d4079357a1f28be o default +#else + $ show_cache + ##### .hg/cache/branch3-served + tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8 topo-mode=pure + default +#endif $ hg log -T '{desc}\n' --rev 'head()' B_4 A_4 @@ -157,7 +170,8 @@ #else $ show_cache ##### .hg/cache/branch3-served - filtered-hash=f8006d64a10d35c011a5c5fa88be1e25c5929514 tip-node=7c29ff2453bf38c75ee8982935739103c38a9284 tip-rev=7 + filtered-hash=f8006d64a10d35c011a5c5fa88be1e25c5929514 tip-node=7c29ff2453bf38c75ee8982935739103c38a9284 tip-rev=7 topo-mode=pure + default #endif $ cd .. @@ -209,7 +223,6 @@ $ show_cache ##### .hg/cache/branch3 obsolete-hash=b6d2b1f5b70f09c25c835edcae69be35f681605c tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8 - 550bb31f072912453ccbb503de1d554616911e88 o default 7c29ff2453bf38c75ee8982935739103c38a9284 o default ##### .hg/cache/branch3-served filtered-hash=f8006d64a10d35c011a5c5fa88be1e25c5929514 obsolete-hash=ac5282439f301518f362f37547fcd52bcc670373 tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8 @@ -251,7 +264,8 @@ #else $ show_cache ##### .hg/cache/branch3-served - filtered-hash=f8006d64a10d35c011a5c5fa88be1e25c5929514 tip-node=7c29ff2453bf38c75ee8982935739103c38a9284 tip-rev=7 + filtered-hash=f8006d64a10d35c011a5c5fa88be1e25c5929514 tip-node=7c29ff2453bf38c75ee8982935739103c38a9284 tip-rev=7 topo-mode=pure + default #endif $ cd .. @@ -299,7 +313,6 @@ $ show_cache ##### .hg/cache/branch3 obsolete-hash=b6d2b1f5b70f09c25c835edcae69be35f681605c tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8 - 550bb31f072912453ccbb503de1d554616911e88 o default 7c29ff2453bf38c75ee8982935739103c38a9284 o default ##### .hg/cache/branch3-served filtered-hash=f1456c0d675980582dda9b8edc7f13f503ce544f obsolete-hash=3e74f5349008671629e39d13d7e00d9ba94c74f7 tip-node=7c29ff2453bf38c75ee8982935739103c38a9284 tip-rev=7 @@ -341,7 +354,8 @@ #else $ show_cache ##### .hg/cache/branch3-served - filtered-hash=f8006d64a10d35c011a5c5fa88be1e25c5929514 tip-node=7c29ff2453bf38c75ee8982935739103c38a9284 tip-rev=7 + filtered-hash=f8006d64a10d35c011a5c5fa88be1e25c5929514 tip-node=7c29ff2453bf38c75ee8982935739103c38a9284 tip-rev=7 topo-mode=pure + default #endif $ cd .. @@ -434,7 +448,8 @@ #else $ show_cache ##### .hg/cache/branch3-served - tip-node=7c29ff2453bf38c75ee8982935739103c38a9284 tip-rev=7 + tip-node=7c29ff2453bf38c75ee8982935739103c38a9284 tip-rev=7 topo-mode=pure + default #endif $ cd .. @@ -477,7 +492,8 @@ #else $ show_cache ##### .hg/cache/branch3-served - tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8 + tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8 topo-mode=pure + default #endif $ hg pull --rev `cat ../main-single-branch-node_B4` --remote-hidden @@ -539,7 +555,8 @@ #else $ show_cache ##### .hg/cache/branch3-served - filtered-hash=f8006d64a10d35c011a5c5fa88be1e25c5929514 tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8 + filtered-hash=f8006d64a10d35c011a5c5fa88be1e25c5929514 tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8 topo-mode=pure + default #endif $ cd ..