Show More
@@ -80,6 +80,7 b' class bmstore(dict):' | |||||
80 | ''' |
|
80 | ''' | |
81 | repo = self._repo |
|
81 | repo = self._repo | |
82 | self._writerepo(repo) |
|
82 | self._writerepo(repo) | |
|
83 | repo.invalidatevolatilesets() | |||
83 |
|
84 | |||
84 | def _writerepo(self, repo): |
|
85 | def _writerepo(self, repo): | |
85 | """Factored out for extensibility""" |
|
86 | """Factored out for extensibility""" |
@@ -927,3 +927,42 b' Test heads computation on pending index ' | |||||
927 | $ echo aa > a |
|
927 | $ echo aa > a | |
928 | $ hg amendtransient |
|
928 | $ hg amendtransient | |
929 | [1, 3] |
|
929 | [1, 3] | |
|
930 | ||||
|
931 | Test cache consistency for the visible filter | |||
|
932 | 1) We want to make sure that the cached filtered revs are invalidated when | |||
|
933 | bookmarks change | |||
|
934 | $ cd .. | |||
|
935 | $ cat >$TESTTMP/test_extension.py << EOF | |||
|
936 | > from mercurial import cmdutil, extensions, bookmarks, repoview | |||
|
937 | > def _bookmarkchanged(orig, bkmstoreinst, *args, **kwargs): | |||
|
938 | > repo = bkmstoreinst._repo | |||
|
939 | > ret = orig(bkmstoreinst, *args, **kwargs) | |||
|
940 | > hidden1 = repoview.computehidden(repo) | |||
|
941 | > hidden = repoview.filterrevs(repo, 'visible') | |||
|
942 | > if sorted(hidden1) != sorted(hidden): | |||
|
943 | > print "cache inconsistency" | |||
|
944 | > return ret | |||
|
945 | > def extsetup(ui): | |||
|
946 | > extensions.wrapfunction(bookmarks.bmstore, 'write', _bookmarkchanged) | |||
|
947 | > EOF | |||
|
948 | ||||
|
949 | $ hg init repo-cache-inconsistency | |||
|
950 | $ cd repo-issue-nativerevs-pending-changes | |||
|
951 | $ mkcommit a | |||
|
952 | a already tracked! | |||
|
953 | $ mkcommit b | |||
|
954 | $ hg id | |||
|
955 | 13bedc178fce tip | |||
|
956 | $ echo "hello" > b | |||
|
957 | $ hg commit --amend -m "message" | |||
|
958 | $ hg book bookb -r 13bedc178fce --hidden | |||
|
959 | $ hg log -r 13bedc178fce | |||
|
960 | 5:13bedc178fce (draft) [ bookb] add b | |||
|
961 | $ hg book -d bookb | |||
|
962 | $ hg log -r 13bedc178fce | |||
|
963 | abort: hidden revision '13bedc178fce'! | |||
|
964 | (use --hidden to access hidden revisions) | |||
|
965 | [255] | |||
|
966 | ||||
|
967 | ||||
|
968 |
General Comments 0
You need to be logged in to leave comments.
Login now