test-histedit-non-commute.t
244 lines
| 6.4 KiB
| text/troff
|
Tads3Lexer
/ tests / test-histedit-non-commute.t
Mads Kiilerich
|
r17085 | $ . "$TESTDIR/histedit-helpers.sh" | ||
$ cat >> $HGRCPATH <<EOF | ||||
> [extensions] | ||||
> graphlog= | ||||
> histedit= | ||||
> EOF | ||||
Mads Kiilerich
|
r17087 | $ EDITED="$TESTTMP/editedhistory" | ||
Mads Kiilerich
|
r17085 | $ cat > $EDITED <<EOF | ||
> pick 177f92b77385 c | ||||
> pick 055a42cdd887 d | ||||
> pick bfa474341cc9 does not commute with e | ||||
> pick e860deea161a e | ||||
> pick 652413bf663e f | ||||
> EOF | ||||
$ initrepo () | ||||
> { | ||||
> hg init $1 | ||||
> cd $1 | ||||
> 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 r1 | ||||
$ cd r1 | ||||
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 | ||||
Mads Kiilerich
|
r17086 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle | ||
Mads Kiilerich
|
r17085 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | ||
1 out of 1 hunks FAILED -- saving rejects to file e.rej | ||||
abort: Fix up the change and run hg histedit --continue | ||||
abort the edit | ||||
$ hg histedit --abort 2>&1 | fixbundle | ||||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
second edit set | ||||
$ 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 | ||||
Mads Kiilerich
|
r17086 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle | ||
Mads Kiilerich
|
r17085 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | ||
1 out of 1 hunks FAILED -- saving rejects to file e.rej | ||||
abort: Fix up the change and run hg histedit --continue | ||||
fix up | ||||
$ echo a > e | ||||
$ hg add e | ||||
$ hg histedit --continue 2>&1 | fixbundle | ||||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
file e already exists | ||||
1 out of 1 hunks FAILED -- saving rejects to file e.rej | ||||
abort: Fix up the change and run hg histedit --continue | ||||
just continue this time | ||||
$ hg histedit --continue 2>&1 | fixbundle | ||||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
log after edit | ||||
$ hg log --graph | ||||
@ changeset: 5:9ab84894b459 | ||||
| tag: tip | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: f | ||||
| | ||||
o changeset: 4:1fff3ae8199d | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: does not commute with 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 | ||||
start over | ||||
$ cd .. | ||||
$ initrepo r2 | ||||
$ cd r2 | ||||
$ cat > $EDITED <<EOF | ||||
> pick 177f92b77385 c | ||||
> pick 055a42cdd887 d | ||||
> mess bfa474341cc9 does not commute with e | ||||
> pick e860deea161a e | ||||
> pick 652413bf663e f | ||||
> EOF | ||||
edit the history, this time with a fold action | ||||
Mads Kiilerich
|
r17086 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle | ||
Mads Kiilerich
|
r17085 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | ||
1 out of 1 hunks FAILED -- saving rejects to file e.rej | ||||
abort: Fix up the change and run hg histedit --continue | ||||
$ echo a > e | ||||
$ hg add e | ||||
Mads Kiilerich
|
r17086 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit --continue 2>&1 | fixbundle | ||
Mads Kiilerich
|
r17085 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
file e already exists | ||||
1 out of 1 hunks FAILED -- saving rejects to file e.rej | ||||
abort: Fix up the change and run hg histedit --continue | ||||
second edit also fails, but just continue | ||||
$ hg histedit --continue 2>&1 | fixbundle | ||||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
post message fix | ||||
$ hg log --graph | ||||
@ changeset: 5:6459970fb49b | ||||
| tag: tip | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: f | ||||
| | ||||
o changeset: 4:556f27c874b0 | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: pick 177f92b77385 c | ||||
| | ||||
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 | ||||
$ cd .. | ||||