##// END OF EJS Templates
strip: invalidate phase cache after stripping changeset (issue5235)...
Laurent Charignon -
r29196:bf7b8157 stable
parent child Browse files
Show More
@@ -194,6 +194,7 b' def strip(ui, repo, nodelist, backup=Tru'
194 if not repo.ui.verbose:
194 if not repo.ui.verbose:
195 repo.ui.popbuffer()
195 repo.ui.popbuffer()
196 f.close()
196 f.close()
197 repo._phasecache.invalidate()
197
198
198 for m in updatebm:
199 for m in updatebm:
199 bm[m] = repo[newbmtarget].node()
200 bm[m] = repo[newbmtarget].node()
@@ -838,6 +838,41 b' strip backup content'
838 date: Thu Jan 01 00:00:00 1970 +0000
838 date: Thu Jan 01 00:00:00 1970 +0000
839 summary: mergeCD
839 summary: mergeCD
840
840
841 Check that the phase cache is properly invalidated after a strip with bookmark.
842
843 $ cat > ../stripstalephasecache.py << EOF
844 > from mercurial import extensions, localrepo
845 > def transactioncallback(orig, repo, desc, *args, **kwargs):
846 > def test(transaction):
847 > # observe cache inconsistency
848 > try:
849 > [repo.changelog.node(r) for r in repo.revs("not public()")]
850 > except IndexError:
851 > repo.ui.status("Index error!\n")
852 > transaction = orig(repo, desc, *args, **kwargs)
853 > # warm up the phase cache
854 > list(repo.revs("not public()"))
855 > if desc != 'strip':
856 > transaction.addpostclose("phase invalidation test", test)
857 > return transaction
858 > def extsetup(ui):
859 > extensions.wrapfunction(localrepo.localrepository, "transaction",
860 > transactioncallback)
861 > EOF
862 $ hg up -C 2
863 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
864 $ echo k > k
865 $ hg add k
866 $ hg commit -m commitK
867 $ echo l > l
868 $ hg add l
869 $ hg commit -m commitL
870 $ hg book -r tip blah
871 $ hg strip ".^" --config extensions.crash=$TESTTMP/stripstalephasecache.py
872 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
873 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/8f0b4384875c-4fa10deb-backup.hg (glob)
874 $ hg up -C 1
875 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
841
876
842 Error during post-close callback of the strip transaction
877 Error during post-close callback of the strip transaction
843 (They should be gracefully handled and reported)
878 (They should be gracefully handled and reported)
General Comments 0
You need to be logged in to leave comments. Login now