Mercurial > hg
diff tests/test-branches.t @ 29744:0d588332ad2c
branchmap: acquires lock before writting the rev branch cache
We now attempt to acquire a lock and write the branch cache within that lock.
This would prevent cache corruption when multiple processes try to write the cache
at the same time.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Fri, 05 Aug 2016 14:57:16 +0200 |
parents | a2a380e2750f |
children | 034412ca28c3 |
line wrap: on
line diff
--- a/tests/test-branches.t Fri Aug 05 14:54:46 2016 +0200 +++ b/tests/test-branches.t Fri Aug 05 14:57:16 2016 +0200 @@ -554,6 +554,18 @@ $ rmdir .hg/cache/rbc-revs-v1 $ mv .hg/cache/rbc-revs-v1_ .hg/cache/rbc-revs-v1 +no errors when wlock cannot be acquired + +#if unix-permissions + $ mv .hg/cache/rbc-revs-v1 .hg/cache/rbc-revs-v1_ + $ rm -f .hg/cache/branch* + $ chmod 555 .hg + $ hg head a -T '{rev}\n' + 5 + $ chmod 755 .hg + $ mv .hg/cache/rbc-revs-v1_ .hg/cache/rbc-revs-v1 +#endif + recovery from invalid cache revs file with trailing data $ echo >> .hg/cache/rbc-revs-v1 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug