test-rebase-transaction.t
204 lines
| 3.6 KiB
| text/troff
|
Tads3Lexer
/ tests / test-rebase-transaction.t
Taapas Agrawal
|
r42832 | #testcases continuecommand continueflag | ||
Martin von Zweigbergk
|
r36833 | Rebasing using a single transaction | ||
Jun Wu
|
r34505 | $ cat >> $HGRCPATH <<EOF | ||
> [extensions] | ||||
> rebase= | ||||
> drawdag=$TESTDIR/drawdag.py | ||||
> | ||||
Martin von Zweigbergk
|
r36833 | > [rebase] | ||
> singletransaction=True | ||||
> | ||||
Jun Wu
|
r34505 | > [phases] | ||
> publish=False | ||||
> | ||||
> [alias] | ||||
> tglog = log -G --template "{rev}: {desc}" | ||||
> EOF | ||||
Taapas Agrawal
|
r42832 | #if continueflag | ||
$ cat >> $HGRCPATH <<EOF | ||||
> [alias] | ||||
> continue = rebase --continue | ||||
> EOF | ||||
#endif | ||||
Martin von Zweigbergk
|
r36833 | Check that a simple rebase works | ||
Jun Wu
|
r34505 | |||
Martin von Zweigbergk
|
r36833 | $ hg init simple && cd simple | ||
Jun Wu
|
r34505 | $ hg debugdrawdag <<'EOF' | ||
> Z | ||||
> | | ||||
> | D | ||||
> | | | ||||
> | C | ||||
> | | | ||||
> Y B | ||||
> |/ | ||||
> A | ||||
> EOF | ||||
Martin von Zweigbergk
|
r36945 | - We should only see one status stored message. It comes from the start. | ||
Jun Wu
|
r34505 | $ hg rebase --debug -b D -d Z | grep 'status stored' | ||
rebase status stored | ||||
$ hg tglog | ||||
o 5: D | ||||
| | ||||
o 4: C | ||||
| | ||||
o 3: B | ||||
| | ||||
o 2: Z | ||||
| | ||||
o 1: Y | ||||
| | ||||
o 0: A | ||||
$ cd .. | ||||
Martin von Zweigbergk
|
r36834 | |||
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 | ||||
Martin von Zweigbergk
|
r36945 | - cmdutil.commitforceeditor() which forces tr.writepending() | ||
Martin von Zweigbergk
|
r36834 | $ 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 | ||||
Martin von Zweigbergk
|
r46356 | rebasing 1:112478962961 B "B" | ||
rebasing 3:c26739dbe603 C "C" | ||||
Martin von Zweigbergk
|
r36834 | merging conflict | ||
warning: conflicts while merging conflict! (edit, then use 'hg resolve --mark') | ||||
Daniel Ploch
|
r45710 | unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') | ||
Martin von Zweigbergk
|
r46430 | [240] | ||
Martin von Zweigbergk
|
r36834 | $ hg tglog | ||
o 5: D | ||||
| | ||||
| @ 4: Z | ||||
| | | ||||
Martin von Zweigbergk
|
r44821 | % | 3: C | ||
Martin von Zweigbergk
|
r36834 | | | | ||
| o 2: Y | ||||
| | | ||||
o | 1: B | ||||
|/ | ||||
o 0: A | ||||
$ hg st | ||||
M conflict | ||||
A B | ||||
Martin von Zweigbergk
|
r44821 | A C | ||
Martin von Zweigbergk
|
r36834 | ? conflict.orig | ||
$ echo resolved > conflict | ||||
$ hg resolve -m | ||||
(no more unresolved files) | ||||
continue: hg rebase --continue | ||||
Taapas Agrawal
|
r42832 | $ hg continue | ||
Martin von Zweigbergk
|
r46356 | already rebased 1:112478962961 B "B" as 79bc8f4973ce | ||
rebasing 3:c26739dbe603 C "C" | ||||
rebasing 5:d24bb333861c D tip "D" | ||||
Martin von Zweigbergk
|
r36834 | 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 | ||||
Martin von Zweigbergk
|
r46356 | rebasing 1:112478962961 B "B" | ||
rebasing 3:26805aba1e60 C "C" | ||||
rebasing 5:f585351a92f8 D tip "D" | ||||
Martin von Zweigbergk
|
r36945 | transaction abort! | ||
rollback completed | ||||
Martin von Zweigbergk
|
r36834 | abort: edit failed: false exited with status 1 | ||
Martin von Zweigbergk
|
r46489 | [250] | ||
Martin von Zweigbergk
|
r36834 | $ hg tglog | ||
o 5: D | ||||
| | ||||
Martin von Zweigbergk
|
r36945 | | o 4: Z | ||
Martin von Zweigbergk
|
r36834 | | | | ||
o | 3: C | ||||
| | | ||||
| o 2: Y | ||||
| | | ||||
o | 1: B | ||||
|/ | ||||
o 0: A | ||||
Taapas Agrawal
|
r42832 | $ hg continue | ||
Martin von Zweigbergk
|
r46356 | rebasing 1:112478962961 B "B" | ||
rebasing 3:26805aba1e60 C "C" | ||||
rebasing 5:f585351a92f8 D tip "D" | ||||
Martin von Zweigbergk
|
r36834 | 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 .. | ||||