Mercurial > hg
comparison tests/test-obsolete.t @ 27917:97e0dc6d248c stable
repoview: fix corrupted hiddencache crash Mercurial (issue5042)
Before this patch if the hiddencache existed but was empty, it would crash
mercurial. This patch adds exception handling when reading the hiddencache to
avoid the issue.
When encountering a corrupted cache file we print a devel warning. There would
be no point in issuing a normal warning as the user wouldn't be able to do
anything about the situation.
The warning looks like:
devel-warn: corrupted hidden cache, removing it at: /path/to/repoview.py
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Wed, 20 Jan 2016 13:43:01 -0800 |
parents | edd2615ad226 |
children | f2004e4908f3 0209bdd553b9 |
comparison
equal
deleted
inserted
replaced
27916:9a09a9cfa503 | 27917:97e0dc6d248c |
---|---|
949 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | 949 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
950 $ echo aa > a | 950 $ echo aa > a |
951 $ hg amendtransient | 951 $ hg amendtransient |
952 [1, 3] | 952 [1, 3] |
953 | 953 |
954 Check that corrupted hidden cache does not crash | |
955 | |
956 $ printf "" > .hg/cache/hidden | |
957 $ hg log -r . -T '{node}' --debug | |
958 corrupted hidden cache | |
959 8fd96dfc63e51ed5a8af1bec18eb4b19dbf83812 (no-eol) | |
960 $ hg log -r . -T '{node}' --debug | |
961 8fd96dfc63e51ed5a8af1bec18eb4b19dbf83812 (no-eol) | |
962 | |
963 Check that wrong hidden cache permission does not crash | |
964 | |
965 $ chmod 000 .hg/cache/hidden | |
966 $ hg log -r . -T '{node}' --debug | |
967 cannot read hidden cache | |
968 error writing hidden changesets cache | |
969 8fd96dfc63e51ed5a8af1bec18eb4b19dbf83812 (no-eol) | |
970 | |
954 Test cache consistency for the visible filter | 971 Test cache consistency for the visible filter |
955 1) We want to make sure that the cached filtered revs are invalidated when | 972 1) We want to make sure that the cached filtered revs are invalidated when |
956 bookmarks change | 973 bookmarks change |
957 $ cd .. | 974 $ cd .. |
958 $ cat >$TESTTMP/test_extension.py << EOF | 975 $ cat >$TESTTMP/test_extension.py << EOF |