test-histedit-non-commute-abort.t
216 lines
| 6.0 KiB
| text/troff
|
Tads3Lexer
/ tests / test-histedit-non-commute-abort.t
|
r17085 | $ . "$TESTDIR/histedit-helpers.sh" | ||
$ cat >> $HGRCPATH <<EOF | ||||
> [extensions] | ||||
> histedit= | ||||
> EOF | ||||
$ initrepo () | ||||
> { | ||||
> hg init r | ||||
> cd r | ||||
> for x in a b c d e f ; do | ||||
> echo $x > $x | ||||
> hg add $x | ||||
> hg ci -m $x | ||||
> done | ||||
> echo a >> e | ||||
> hg ci -m 'does not commute with e' | ||||
> cd .. | ||||
> } | ||||
$ initrepo | ||||
$ cd r | ||||
log before edit | ||||
$ hg log --graph | ||||
@ changeset: 6:bfa474341cc9 | ||||
| tag: tip | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: does not commute with e | ||||
| | ||||
o changeset: 5:652413bf663e | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: f | ||||
| | ||||
o changeset: 4:e860deea161a | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: e | ||||
| | ||||
o changeset: 3:055a42cdd887 | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: d | ||||
| | ||||
o changeset: 2:177f92b77385 | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: c | ||||
| | ||||
o changeset: 1:d2ae7f538514 | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: b | ||||
| | ||||
o changeset: 0:cb9a9f314b8b | ||||
user: test | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: a | ||||
edit the history | ||||
|
r19019 | $ hg histedit 177f92b77385 --commands - 2>&1 <<EOF | fixbundle | ||
> pick 177f92b77385 c | ||||
> pick 055a42cdd887 d | ||||
> pick bfa474341cc9 does not commute with e | ||||
> pick e860deea161a e | ||||
> pick 652413bf663e f | ||||
> EOF | ||||
|
r17647 | merging e | ||
|
r26614 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') | ||
|
r27629 | Fix up the change (pick e860deea161a) | ||
(hg histedit --continue to resume) | ||||
|
r17085 | |||
|
r27027 | insert unsupported advisory merge record | ||
$ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -x | ||||
$ hg debugmergestate | ||||
* version 2 records | ||||
local: 8f7551c7e4a2f2efe0bc8c741baf7f227d65d758 | ||||
other: e860deea161a2f77de56603b340ebbb4536308ae | ||||
|
r28634 | labels: | ||
local: local | ||||
other: histedit | ||||
|
r27027 | unrecognized entry: x advisory record | ||
|
r28011 | file extras: e (ancestorlinknode = 0000000000000000000000000000000000000000) | ||
|
r27027 | file: e (record type "F", state "u", hash 58e6b3a414a1e090dfc6029add0f3555ccba127f) | ||
local path: e (flags "") | ||||
|
r27134 | ancestor path: e (node null) | ||
|
r27027 | other path: e (node 6b67ccefd5ce6de77e7ead4f5292843a0255329f) | ||
$ hg resolve -l | ||||
U e | ||||
|
r17085 | |||
|
r27027 | insert unsupported mandatory merge record | ||
$ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -X | ||||
$ hg debugmergestate | ||||
* version 2 records | ||||
local: 8f7551c7e4a2f2efe0bc8c741baf7f227d65d758 | ||||
other: e860deea161a2f77de56603b340ebbb4536308ae | ||||
|
r28634 | labels: | ||
local: local | ||||
other: histedit | ||||
|
r28011 | file extras: e (ancestorlinknode = 0000000000000000000000000000000000000000) | ||
|
r27027 | file: e (record type "F", state "u", hash 58e6b3a414a1e090dfc6029add0f3555ccba127f) | ||
local path: e (flags "") | ||||
|
r27134 | ancestor path: e (node null) | ||
|
r27027 | other path: e (node 6b67ccefd5ce6de77e7ead4f5292843a0255329f) | ||
unrecognized entry: X mandatory record | ||||
$ hg resolve -l | ||||
abort: unsupported merge state records: X | ||||
(see https://mercurial-scm.org/wiki/MergeStateRecords for more information) | ||||
[255] | ||||
$ hg resolve -ma | ||||
abort: unsupported merge state records: X | ||||
(see https://mercurial-scm.org/wiki/MergeStateRecords for more information) | ||||
[255] | ||||
abort the edit (should clear out merge state) | ||||
|
r17085 | $ hg histedit --abort 2>&1 | fixbundle | ||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
|
r27027 | $ hg debugmergestate | ||
no merge state found | ||||
|
r17085 | |||
log after abort | ||||
|
r17647 | $ hg resolve -l | ||
|
r17085 | $ hg log --graph | ||
@ changeset: 6:bfa474341cc9 | ||||
| tag: tip | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: does not commute with e | ||||
| | ||||
o changeset: 5:652413bf663e | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: f | ||||
| | ||||
o changeset: 4:e860deea161a | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: e | ||||
| | ||||
o changeset: 3:055a42cdd887 | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: d | ||||
| | ||||
o changeset: 2:177f92b77385 | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: c | ||||
| | ||||
o changeset: 1:d2ae7f538514 | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: b | ||||
| | ||||
o changeset: 0:cb9a9f314b8b | ||||
user: test | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: a | ||||
|
r43246 | Early tree conflict doesn't leave histedit in a wedged state. | ||
$ hg rm c | ||||
$ hg ci -m 'remove c' | ||||
$ echo collision > c | ||||
$ hg histedit e860deea161a --commands - 2>&1 <<EOF | ||||
> edit e860deea161a | ||||
> pick 652413bf663e | ||||
> pick bfa474341cc9 | ||||
> pick 1b0954ff00fc | ||||
> EOF | ||||
c: untracked file differs | ||||
abort: untracked files in working directory differ from files in requested revision | ||||
[255] | ||||
BUG: we didn't actually change p1 of the working copy, but we're in a | ||||
histedit state. This confuses the process very badly and leads to | ||||
histedit stripping things it shouldn't (in obsmarker mode it inserts | ||||
bogus prune markers in this case.) | ||||
$ hg log -r 'p1()' -T'{node}\n' | ||||
1b0954ff00fccb15a37b679e4a35e9b01dfe685e | ||||
$ hg status --config ui.tweakdefaults=yes | ||||
? c | ||||
? e.orig | ||||
# The repository is in an unfinished *histedit* state. | ||||
# To continue: hg histedit --continue | ||||
# To abort: hg histedit --abort | ||||
$ hg histedit --continue | ||||
652413bf663e: skipping changeset (no changes) | ||||
bfa474341cc9: skipping changeset (no changes) | ||||
1b0954ff00fc: skipping changeset (no changes) | ||||
saved backup bundle to $TESTTMP/r/.hg/strip-backup/e860deea161a-a0738322-histedit.hg | ||||
$ hg log -GTcompact | ||||
warning: ignoring unknown working parent 1b0954ff00fc! | ||||
o 3[tip] 055a42cdd887 1970-01-01 00:00 +0000 test | ||||
| d | ||||
| | ||||
o 2 177f92b77385 1970-01-01 00:00 +0000 test | ||||
| c | ||||
| | ||||
o 1 d2ae7f538514 1970-01-01 00:00 +0000 test | ||||
| b | ||||
| | ||||
o 0 cb9a9f314b8b 1970-01-01 00:00 +0000 test | ||||
a | ||||
|
r17085 | $ cd .. | ||