Mercurial > hg
comparison tests/test-branches.t @ 51492:2e8a88e5809f
branchcache: stop writing more branchcache file on disk than needed
Before this change, we were unconditionally writing a branchmap file for the
filter level passed to `update_disk`. This is actually counter productive if no
update were needed for this filter level. In many case, the branch cache for a
filter level is identical to its parent "subset" and it is better to simply
keep the subset update and reuse it every time instead of having to do identical
work for similar subset.
So we change the `update_disk` method to only write a file when that filter
level differ from its parent. This removes many cases where identical files were
written, requiring multiple boring update in the test suite.
The only notable changes is the change to `test-strip-branch-cache.t`, this
case was checking a scenario that no longer reproduce the bug as writing less
branchmap file result in less stalled cache on disk.
Strictly speaking, we could create a more convoluted scenario that create a
similar issue. However the next changeset would also cover that scenario so we
directly updated that test case to a "no longer buggy" state.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 10 Mar 2024 04:53:17 +0100 |
parents | 02e7d79edf62 |
children | 0239ebdd0740 |
comparison
equal
deleted
inserted
replaced
51491:dd5b5f99940d | 51492:2e8a88e5809f |
---|---|
1314 adding file changes | 1314 adding file changes |
1315 added 2 changesets with 0 changes to 0 files | 1315 added 2 changesets with 0 changes to 0 files |
1316 new changesets 2ab8003a1750:99ba08759bc7 | 1316 new changesets 2ab8003a1750:99ba08759bc7 |
1317 updating to branch A | 1317 updating to branch A |
1318 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1318 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
1319 $ cat branchmap-update-01/.hg/cache/branch2-served | 1319 $ cat branchmap-update-01/.hg/cache/branch2-base |
1320 99ba08759bc7f6fdbe5304e83d0387f35c082479 1 | 1320 99ba08759bc7f6fdbe5304e83d0387f35c082479 1 |
1321 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A | 1321 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A |
1322 $ hg -R branchmap-update-01 unbundle bundle.hg | 1322 $ hg -R branchmap-update-01 unbundle bundle.hg |
1323 adding changesets | 1323 adding changesets |
1324 adding manifests | 1324 adding manifests |
1348 added 2 changesets with 0 changes to 0 files | 1348 added 2 changesets with 0 changes to 0 files |
1349 new changesets 2ab8003a1750:99ba08759bc7 | 1349 new changesets 2ab8003a1750:99ba08759bc7 |
1350 updating to branch A | 1350 updating to branch A |
1351 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1351 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
1352 | 1352 |
1353 $ cat branchmap-update-02/.hg/cache/branch2-served | 1353 $ cat branchmap-update-02/.hg/cache/branch2-base |
1354 99ba08759bc7f6fdbe5304e83d0387f35c082479 1 | 1354 99ba08759bc7f6fdbe5304e83d0387f35c082479 1 |
1355 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A | 1355 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A |
1356 $ hg -R branchmap-update-02 unbundle bundle.hg --config "hooks.pretxnclose=python:$TESTTMP/simplehook.py:hook" | 1356 $ hg -R branchmap-update-02 unbundle bundle.hg --config "hooks.pretxnclose=python:$TESTTMP/simplehook.py:hook" |
1357 adding changesets | 1357 adding changesets |
1358 adding manifests | 1358 adding manifests |
1359 adding file changes | 1359 adding file changes |
1360 transaction abort! | 1360 transaction abort! |
1361 rollback completed | 1361 rollback completed |
1362 abort: pretxnclose hook failed | 1362 abort: pretxnclose hook failed |
1363 [40] | 1363 [40] |
1364 $ cat branchmap-update-02/.hg/cache/branch2-served | 1364 $ cat branchmap-update-02/.hg/cache/branch2-base |
1365 99ba08759bc7f6fdbe5304e83d0387f35c082479 1 | 1365 99ba08759bc7f6fdbe5304e83d0387f35c082479 1 |
1366 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A | 1366 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A |