D1933: repair: invalidate volatile sets after stripping
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Sun Jan 21 18:41:25 UTC 2018
martinvonz created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
Matt Harbison reported that some tests were broken on Windows after
https://phab.mercurial-scm.org/rHG1a09dad8b85a2c1f4aa99e112185a7dde2f4c115 (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.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D1933
AFFECTED FILES
mercurial/repair.py
tests/test-histedit-obsolete.t
tests/test-rebase-obsolete.t
tests/test-single-head.t
CHANGE DETAILS
diff --git a/tests/test-single-head.t b/tests/test-single-head.t
--- a/tests/test-single-head.t
+++ b/tests/test-single-head.t
@@ -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!
diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -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
|
diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t
--- a/tests/test-histedit-obsolete.t
+++ b/tests/test-histedit-obsolete.t
@@ -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
diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -203,6 +203,7 @@
deleteobsmarkers(repo.obsstore, stripobsidx)
del repo.obsstore
+ repo.invalidatevolatilesets()
repo._phasecache.filterunknown(repo)
if tmpbundlefile:
To: martinvonz, durin42, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list