# HG changeset patch # User Pierre-Yves David # Date 1600423812 -7200 # Node ID 27822b8436bfb1dd1a394b77468ea9e67df678bd # Parent bd5b2b29b82df1e2de214a59a8aa60eb80ee27f9 test-strip: display more information highlight buggy behavior When using `hg strip --keep` on a set of changeset that contains a merge, the set of file considered when rebuilding the dirstate is missing files updated by changeset that are not directly inside the `new-parent::old-parent` range. We start with updating the test with new output highlighting the issue. This issue was spotted because that dirstate inconsistency made the test flaky. The new command make the test less flaky (but still wrong). diff -r bd5b2b29b82d -r 27822b8436bf tests/test-strip.t --- a/tests/test-strip.t Sun Sep 13 15:59:23 2020 +0900 +++ b/tests/test-strip.t Fri Sep 18 12:10:12 2020 +0200 @@ -1177,6 +1177,10 @@ summary: commitA +stripping a set containing a merge properly reset file content, including items on other branches + +BROKEN, The added file should move to unknown, which is the behavior we have been seeing for other `hg strip --keep` call. + $ hg unbundle -u $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg adding changesets adding manifests @@ -1185,6 +1189,50 @@ new changesets 35358f982181:4cf5e92caec2 (2 drafts) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg id + 4cf5e92caec2 (new-branch) tip + $ hg status --rev "f62c6c09b707" + A bar.txt + $ hg diff --rev "f62c6c09b707" + diff -r f62c6c09b707 bar.txt + --- /dev/null Thu Jan 01 00:00:00 1970 +0000 + +++ b/bar.txt Thu Jan 01 00:00:00 1970 +0000 + @@ -0,0 +1,1 @@ + +bar + $ hg log -G -v --rev 35358f982181:: --patch + @ changeset: 5:4cf5e92caec2 + |\ branch: new-branch + | ~ tag: tip + | parent: 3:f62c6c09b707 + | parent: 4:35358f982181 + | user: test + | date: Thu Jan 01 00:00:00 1970 +0000 + | description: + | merge + | + | + | diff -r f62c6c09b707 -r 4cf5e92caec2 bar.txt + | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 + | +++ b/bar.txt Thu Jan 01 00:00:00 1970 +0000 + | @@ -0,0 +1,1 @@ + | +bar + | + o changeset: 4:35358f982181 + | parent: 1:eca11cf91c71 + ~ user: test + date: Thu Jan 01 00:00:00 1970 +0000 + files: bar.txt + description: + bar + + + diff -r eca11cf91c71 -r 35358f982181 bar.txt + --- /dev/null Thu Jan 01 00:00:00 1970 +0000 + +++ b/bar.txt Thu Jan 01 00:00:00 1970 +0000 + @@ -0,0 +1,1 @@ + +bar + + $ hg strip -k -r 35358f982181 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg $ hg log -G @@ -1211,12 +1259,17 @@ date: Thu Jan 01 00:00:00 1970 +0000 summary: commitA - $ hg diff - diff -r f62c6c09b707 bar.txt - --- /dev/null Thu Jan 01 00:00:00 1970 +0000 - +++ b/bar.txt Thu Jan 01 00:00:00 1970 +0000 - @@ -0,0 +1,1 @@ - +bar + +BROKEN: 'bar.txt' cannot possibly be clean since it is not part of the current +working copy parents. + + $ hg status -A + C a + C b + C bar.txt + C foo.txt + $ cat bar.txt + bar Use delayedstrip to strip inside a transaction