changeset 35778:128dd940bedc

repair: invalidate volatile sets after stripping Matt Harbison reported that some tests were broken on Windows after 1a09dad8b85a (evolution: report new unstable changesets, 2018-01-14). The failures were exactly as seen in this patch. The failures actually seemed correct, which made me wonder why they didn't fail the same way on Linux. It turned out to be a cache invalidation problem. The new orphan mentioned in the test case actually does get created when we're re-applying the temporary bundle that's created while stripping. However, without the invalidation, it appears that there was already an orphan before applying the temporary bundle. The warnings about unknown working parent appear because the aformentioned changeset means that we're now accessing the dirstate while it's invalid. We may want to suppress these messages that happen in the intermediate strip state, but they're technically correct (although confusing to the user), so I think just fixing the cache invalidation is fine for now. I haven't figured out why the caches seemed to get correctly invalidated on Windows. Differential Revision: https://phab.mercurial-scm.org/D1933
author Martin von Zweigbergk <martinvonz@google.com>
date Sat, 20 Jan 2018 23:21:59 -0800
parents 0c0689a7565e
children eefabd9ed3e1
files mercurial/repair.py tests/test-histedit-obsolete.t tests/test-rebase-obsolete.t tests/test-single-head.t
diffstat 4 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/repair.py	Sun Jan 21 13:54:05 2018 -0500
+++ b/mercurial/repair.py	Sat Jan 20 23:21:59 2018 -0800
@@ -203,6 +203,7 @@
 
             deleteobsmarkers(repo.obsstore, stripobsidx)
             del repo.obsstore
+            repo.invalidatevolatilesets()
             repo._phasecache.filterunknown(repo)
 
         if tmpbundlefile:
--- a/tests/test-histedit-obsolete.t	Sun Jan 21 13:54:05 2018 -0500
+++ b/tests/test-histedit-obsolete.t	Sat Jan 20 23:21:59 2018 -0800
@@ -71,6 +71,7 @@
   $ hg commit --amend -X . -m XXXXXX
   $ hg commit --amend -X . -m b2
   $ hg --hidden --config extensions.strip= strip 'desc(XXXXXX)' --no-backup
+  warning: ignoring unknown working parent aba7da937030!
   $ hg histedit --continue
   $ hg log -G
   @  8:273c1f3b8626 c
--- a/tests/test-rebase-obsolete.t	Sun Jan 21 13:54:05 2018 -0500
+++ b/tests/test-rebase-obsolete.t	Sat Jan 20 23:21:59 2018 -0800
@@ -772,6 +772,7 @@
   1 new orphan changesets
   $ hg --hidden strip -r 'desc(B1)'
   saved backup bundle to $TESTTMP/obsskip/.hg/strip-backup/86f6414ccda7-b1c452ee-backup.hg
+  1 new orphan changesets
   $ hg log -G
   @  5:1a79b7535141 D
   |
--- a/tests/test-single-head.t	Sun Jan 21 13:54:05 2018 -0500
+++ b/tests/test-single-head.t	Sat Jan 20 23:21:59 2018 -0800
@@ -200,4 +200,5 @@
 
   $ hg strip --config extensions.strip= --rev 'desc("c_dH0")'
   saved backup bundle to $TESTTMP/client/.hg/strip-backup/fe47ea669cea-a41bf5a9-backup.hg
+  warning: ignoring unknown working parent 49003e504178!