D2757: tests: add a few tests involving --collapse and rebase.singletransaction=1

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri Mar 9 17:29:40 EST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG5b84bdd511eb: tests: add a few tests involving --collapse and rebase.singletransaction=1 (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2757?vs=6767&id=6793

REVISION DETAIL
  https://phab.mercurial-scm.org/D2757

AFFECTED FILES
  tests/test-rebase-transaction.t

CHANGE DETAILS

diff --git a/tests/test-rebase-transaction.t b/tests/test-rebase-transaction.t
--- a/tests/test-rebase-transaction.t
+++ b/tests/test-rebase-transaction.t
@@ -48,3 +48,149 @@
   o  0: A
   
   $ cd ..
+
+Check that --collapse works
+
+  $ hg init collapse && cd collapse
+  $ hg debugdrawdag <<'EOF'
+  >   Z
+  >   |
+  >   | D
+  >   | |
+  >   | C
+  >   | |
+  >   Y B
+  >   |/
+  >   A
+  > EOF
+- We should only see two status stored messages. One from the start, one from
+- the end.
+  $ hg rebase --collapse --debug -b D -d Z | grep 'status stored'
+  rebase status stored
+  rebase status stored
+  $ hg tglog
+  o  3: Collapsed revision
+  |  * B
+  |  * C
+  |  * D
+  o  2: Z
+  |
+  o  1: Y
+  |
+  o  0: A
+  
+  $ cd ..
+
+With --collapse, check that conflicts can be resolved and rebase can then be
+continued
+
+  $ hg init collapse-conflict && cd collapse-conflict
+  $ hg debugdrawdag <<'EOF'
+  >   Z   # Z/conflict=Z
+  >   |
+  >   | D
+  >   | |
+  >   | C # C/conflict=C
+  >   | |
+  >   Y B
+  >   |/
+  >   A
+  > EOF
+  $ hg rebase --collapse -b D -d Z
+  rebasing 1:112478962961 "B" (B)
+  rebasing 3:c26739dbe603 "C" (C)
+  merging conflict
+  warning: conflicts while merging conflict! (edit, then use 'hg resolve --mark')
+  unresolved conflicts (see hg resolve, then hg rebase --continue)
+  [1]
+  $ hg tglog
+  o  5: D
+  |
+  | @  4: Z
+  | |
+  @ |  3: C
+  | |
+  | o  2: Y
+  | |
+  o |  1: B
+  |/
+  o  0: A
+  
+  $ hg st
+  M C
+  M conflict
+  A B
+  ? conflict.orig
+  $ echo resolved > conflict
+  $ hg resolve -m
+  (no more unresolved files)
+  continue: hg rebase --continue
+  $ hg rebase --continue
+  already rebased 1:112478962961 "B" (B) as 79bc8f4973ce
+  rebasing 3:c26739dbe603 "C" (C)
+  rebasing 5:d24bb333861c "D" (D tip)
+  saved backup bundle to $TESTTMP/collapse-conflict/.hg/strip-backup/112478962961-b5b34645-rebase.hg
+  $ hg tglog
+  o  3: Collapsed revision
+  |  * B
+  |  * C
+  |  * D
+  o  2: Z
+  |
+  o  1: Y
+  |
+  o  0: A
+  
+  $ cd ..
+
+With --collapse, check that the commit message editing can be canceled and
+rebase can then be continued
+
+  $ hg init collapse-cancel-editor && cd collapse-cancel-editor
+  $ hg debugdrawdag <<'EOF'
+  >   Z
+  >   |
+  >   | D
+  >   | |
+  >   | C
+  >   | |
+  >   Y B
+  >   |/
+  >   A
+  > EOF
+  $ HGEDITOR=false hg --config ui.interactive=1 rebase --collapse -b D -d Z
+  rebasing 1:112478962961 "B" (B)
+  rebasing 3:26805aba1e60 "C" (C)
+  rebasing 5:f585351a92f8 "D" (D tip)
+  abort: edit failed: false exited with status 1
+  [255]
+  $ hg tglog
+  o  5: D
+  |
+  | @  4: Z
+  | |
+  o |  3: C
+  | |
+  | o  2: Y
+  | |
+  o |  1: B
+  |/
+  o  0: A
+  
+  $ hg rebase --continue
+  already rebased 1:112478962961 "B" (B) as e9b22a392ce0
+  already rebased 3:26805aba1e60 "C" (C) as e9b22a392ce0
+  already rebased 5:f585351a92f8 "D" (D tip) as e9b22a392ce0
+  saved backup bundle to $TESTTMP/collapse-cancel-editor/.hg/strip-backup/112478962961-cb2a9b47-rebase.hg
+  $ hg tglog
+  o  3: Collapsed revision
+  |  * B
+  |  * C
+  |  * D
+  o  2: Z
+  |
+  o  1: Y
+  |
+  o  0: A
+  
+  $ cd ..



To: martinvonz, #hg-reviewers, durin42
Cc: mercurial-devel


More information about the Mercurial-devel mailing list