##// END OF EJS Templates
repoview: fix corrupted hiddencache crash Mercurial (issue5042)...
Laurent Charignon -
r27917:97e0dc6d stable
parent child Browse files
Show More
@@ -150,6 +150,13 def tryreadcache(repo, hideable):
150 150 count = len(data) / 4
151 151 hidden = frozenset(struct.unpack('>%ii' % count, data))
152 152 return hidden
153 except struct.error:
154 repo.ui.debug('corrupted hidden cache\n')
155 # No need to fix the content as it will get rewritten
156 return None
157 except (IOError, OSError):
158 repo.ui.debug('cannot read hidden cache\n')
159 return None
153 160 finally:
154 161 if fh:
155 162 fh.close()
@@ -951,6 +951,23 Test heads computation on pending index
951 951 $ hg amendtransient
952 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 971 Test cache consistency for the visible filter
955 972 1) We want to make sure that the cached filtered revs are invalidated when
956 973 bookmarks change
General Comments 0
You need to be logged in to leave comments. Login now