Patchwork test-rebase-conflicts: add a test case about turning obsstore on and off

login
register
mail settings
Submitter Jun Wu
Date June 24, 2017, 5:32 p.m.
Message ID <32b3dc3f7306e2160e89.1498325547@x1c>
Download mbox | patch
Permalink /patch/21675/
State Accepted
Headers show

Comments

Jun Wu - June 24, 2017, 5:32 p.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1498325501 25200
#      Sat Jun 24 10:31:41 2017 -0700
# Node ID 32b3dc3f7306e2160e89b37daf0a0f68b76bf879
# Parent  fac9941bd542e3621082b157fb2f3aff09cfb1b7
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 32b3dc3f7306
test-rebase-conflicts: add a test case about turning obsstore on and off

Turning obsstore and allowunstable on, rebase will skip the
"can't remove original changesets with unrebased descendants" check. Then
rebase could be interrupted (merge conflict), and the user has a chance to
turn off obsstore. If rebase continues, the current code may strip
irrelevant commits (in the test case added, "C" got stripped unexpectedly).

The test case reproduces issue5606. It will be fixed by the "multidest"
rebase refactoring being reviewed. The test case itself is relatively
separate from the rebase refactoring, therefore sent separately hoping to
reduce the number of patches of the main rebase series.
Augie Fackler - June 24, 2017, 7:36 p.m.
On Sat, Jun 24, 2017 at 10:32:27AM -0700, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark@fb.com>
> # Date 1498325501 25200
> #      Sat Jun 24 10:31:41 2017 -0700
> # Node ID 32b3dc3f7306e2160e89b37daf0a0f68b76bf879
> # Parent  fac9941bd542e3621082b157fb2f3aff09cfb1b7
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r 32b3dc3f7306
> test-rebase-conflicts: add a test case about turning obsstore on and off

queued, thanks

Patch

diff --git a/tests/test-rebase-conflicts.t b/tests/test-rebase-conflicts.t
--- a/tests/test-rebase-conflicts.t
+++ b/tests/test-rebase-conflicts.t
@@ -4,4 +4,5 @@ 
   > [extensions]
   > rebase=
+  > drawdag=$TESTDIR/drawdag.py
   > 
   > [phases]
@@ -360,2 +361,49 @@  Test minimization of merge conflicts
   +c
   +>>>>>>> source: 7bc217434fc1 - test: abc
+
+Test rebase with obsstore turned on and off (issue5606)
+
+  $ cd $TESTTMP
+  $ hg init b
+  $ cd b
+  $ hg debugdrawdag <<'EOS'
+  > D
+  > |
+  > C
+  > |
+  > B E
+  > |/
+  > A
+  > EOS
+
+  $ hg update E -q
+  $ echo 3 > B
+  $ hg commit --amend -m E -A B -q
+  $ hg rebase -r B+D -d . --config experimental.evolution=all
+  rebasing 1:112478962961 "B" (B)
+  merging B
+  warning: conflicts while merging B! (edit, then use 'hg resolve --mark')
+  unresolved conflicts (see hg resolve, then hg rebase --continue)
+  [1]
+
+  $ echo 4 > B
+  $ hg resolve -m
+  (no more unresolved files)
+  continue: hg rebase --continue
+  $ hg rebase --continue --config experimental.evolution=none
+  rebasing 1:112478962961 "B" (B)
+  not rebasing ignored 2:26805aba1e60 "C" (C)
+  rebasing 3:f585351a92f8 "D" (D)
+  saved backup bundle to $TESTTMP/b/.hg/strip-backup/f585351a92f8-cb2a9b47-backup.hg (glob)
+
+  $ rm .hg/localtags
+  $ hg tglog
+  o  3:draft 'D'
+  |
+  o  2:draft 'B'
+  |
+  @  1:draft 'E'
+  |
+  o  0:draft 'A'
+  
+Note the above graph is wrong since C got stripped incorrectly.