Patchwork [1,of,2,STABLE] test-strip: display more information highlight buggy behavior

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 18, 2020, 11:23 a.m.
Message ID <dc7e034e4408b42fedf1.1600428239@nodosa.octobus.net>
Download mbox | patch
Permalink /patch/47218/
State Accepted
Headers show

Comments

Pierre-Yves David - Sept. 18, 2020, 11:23 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1600423812 -7200
#      Fri Sep 18 12:10:12 2020 +0200
# Branch stable
# Node ID dc7e034e4408b42fedf1233961acba1dd643d85e
# Parent  4ebc5f325bedfc8fc98b3c41fda7892563142146
# EXP-Topic issue6270
# Available At https://foss.heptapod.net/octobus/mercurial-devel/
#              hg pull https://foss.heptapod.net/octobus/mercurial-devel/ -r dc7e034e4408
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).
Yuya Nishihara - Sept. 19, 2020, 2:58 a.m.
On Fri, 18 Sep 2020 13:23:59 +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@octobus.net>
> # Date 1600423812 -7200
> #      Fri Sep 18 12:10:12 2020 +0200
> # Branch stable
> # Node ID dc7e034e4408b42fedf1233961acba1dd643d85e
> # Parent  4ebc5f325bedfc8fc98b3c41fda7892563142146
> # EXP-Topic issue6270
> # Available At https://foss.heptapod.net/octobus/mercurial-devel/
> #              hg pull https://foss.heptapod.net/octobus/mercurial-devel/ -r dc7e034e4408
> test-strip: display more information highlight buggy behavior

Queued for stable, thanks.

Patch

diff --git a/tests/test-strip.t b/tests/test-strip.t
--- a/tests/test-strip.t
+++ b/tests/test-strip.t
@@ -1177,6 +1177,10 @@  test stripping a working directory paren
      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 @@  test stripping a working directory paren
   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 @@  test stripping a working directory paren
      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