test-histedit-non-commute.t
298 lines
| 8.3 KiB
| text/troff
|
Tads3Lexer
/ tests / test-histedit-non-commute.t
|
r17085 | $ . "$TESTDIR/histedit-helpers.sh" | ||
$ cat >> $HGRCPATH <<EOF | ||||
> [extensions] | ||||
> histedit= | ||||
> EOF | ||||
$ initrepo () | ||||
> { | ||||
> hg init $1 | ||||
> cd $1 | ||||
> for x in a b c d e f ; do | ||||
|
r17646 | > echo $x$x$x$x$x > $x | ||
> hg add $x | ||||
> done | ||||
> hg ci -m 'Initial commit' | ||||
> for x in a b c d e f ; do | ||||
|
r17085 | > echo $x > $x | ||
> hg ci -m $x | ||||
> done | ||||
|
r17646 | > echo 'I can haz no commute' > e | ||
|
r17085 | > hg ci -m 'does not commute with e' | ||
> cd .. | ||||
> } | ||||
$ initrepo r1 | ||||
$ cd r1 | ||||
|
r17646 | Initial generation of the command files | ||
$ EDITED="$TESTTMP/editedhistory" | ||||
$ hg log --template 'pick {node|short} {rev} {desc}\n' -r 3 >> $EDITED | ||||
$ hg log --template 'pick {node|short} {rev} {desc}\n' -r 4 >> $EDITED | ||||
$ hg log --template 'pick {node|short} {rev} {desc}\n' -r 7 >> $EDITED | ||||
$ hg log --template 'pick {node|short} {rev} {desc}\n' -r 5 >> $EDITED | ||||
$ hg log --template 'pick {node|short} {rev} {desc}\n' -r 6 >> $EDITED | ||||
$ cat $EDITED | ||||
pick 65a9a84f33fd 3 c | ||||
pick 00f1c5383965 4 d | ||||
pick 39522b764e3d 7 does not commute with e | ||||
pick 7b4e2f4b7bcd 5 e | ||||
pick 500cac37a696 6 f | ||||
|
r17085 | log before edit | ||
$ hg log --graph | ||||
|
r17646 | @ changeset: 7:39522b764e3d | ||
|
r17085 | | tag: tip | ||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: does not commute with e | ||||
| | ||||
|
r17646 | o changeset: 6:500cac37a696 | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: f | ||||
| | ||||
|
r17646 | o changeset: 5:7b4e2f4b7bcd | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: e | ||||
| | ||||
|
r17646 | o changeset: 4:00f1c5383965 | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: d | ||||
| | ||||
|
r17646 | o changeset: 3:65a9a84f33fd | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: c | ||||
| | ||||
|
r17646 | o changeset: 2:da6535b52e45 | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: b | ||||
| | ||||
|
r17646 | o changeset: 1:c1f09da44841 | ||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: a | ||||
| | ||||
o changeset: 0:1715188a53c7 | ||||
|
r17085 | user: test | ||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
|
r17646 | summary: Initial commit | ||
|
r17085 | |||
edit the history | ||||
|
r19019 | $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle | ||
|
r17646 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
|
r17647 | merging e | ||
warning: conflicts during merge. | ||||
merging e incomplete! (edit conflicts, then use 'hg resolve --mark') | ||||
|
r18934 | Fix up the change and run hg histedit --continue | ||
|
r17085 | |||
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 | ||||
|
r17646 | @ changeset: 7:39522b764e3d | ||
|
r17085 | | tag: tip | ||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: does not commute with e | ||||
| | ||||
|
r17646 | o changeset: 6:500cac37a696 | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: f | ||||
| | ||||
|
r17646 | o changeset: 5:7b4e2f4b7bcd | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: e | ||||
| | ||||
|
r17646 | o changeset: 4:00f1c5383965 | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: d | ||||
| | ||||
|
r17646 | o changeset: 3:65a9a84f33fd | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: c | ||||
| | ||||
|
r17646 | o changeset: 2:da6535b52e45 | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: b | ||||
| | ||||
|
r17646 | o changeset: 1:c1f09da44841 | ||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: a | ||||
| | ||||
o changeset: 0:1715188a53c7 | ||||
|
r17085 | user: test | ||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
|
r17646 | summary: Initial commit | ||
|
r17085 | |||
edit the history | ||||
|
r19019 | $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle | ||
|
r17646 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
|
r17647 | merging e | ||
warning: conflicts during merge. | ||||
merging e incomplete! (edit conflicts, then use 'hg resolve --mark') | ||||
|
r18934 | Fix up the change and run hg histedit --continue | ||
|
r17085 | |||
fix up | ||||
|
r17646 | $ echo 'I can haz no commute' > e | ||
|
r17647 | $ hg resolve --mark e | ||
|
r21267 | no more unresolved files | ||
|
r17085 | $ hg histedit --continue 2>&1 | fixbundle | ||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
|
r17647 | merging e | ||
warning: conflicts during merge. | ||||
merging e incomplete! (edit conflicts, then use 'hg resolve --mark') | ||||
|
r18934 | Fix up the change and run hg histedit --continue | ||
|
r17085 | |||
|
r17688 | This failure is caused by 7b4e2f4b7bcd "e" not rebasing the non commutative | ||
former children. | ||||
|
r17085 | just continue this time | ||
|
r17647 | $ hg revert -r 'p1()' e | ||
$ hg resolve --mark e | ||||
|
r21267 | no more unresolved files | ||
|
r17085 | $ 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 | ||||
|
r18437 | @ changeset: 6:7efe1373e4bc | ||
|
r17085 | | tag: tip | ||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: f | ||||
| | ||||
|
r18437 | o changeset: 5:e334d87a1e55 | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: does not commute with e | ||||
| | ||||
|
r17646 | o changeset: 4:00f1c5383965 | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: d | ||||
| | ||||
|
r17646 | o changeset: 3:65a9a84f33fd | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: c | ||||
| | ||||
|
r17646 | o changeset: 2:da6535b52e45 | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: b | ||||
| | ||||
|
r17646 | o changeset: 1:c1f09da44841 | ||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: a | ||||
| | ||||
o changeset: 0:1715188a53c7 | ||||
|
r17085 | user: test | ||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
|
r17646 | summary: Initial commit | ||
|
r17085 | |||
start over | ||||
$ cd .. | ||||
$ initrepo r2 | ||||
$ cd r2 | ||||
|
r17646 | $ rm $EDITED | ||
$ hg log --template 'pick {node|short} {rev} {desc}\n' -r 3 >> $EDITED | ||||
$ hg log --template 'pick {node|short} {rev} {desc}\n' -r 4 >> $EDITED | ||||
$ hg log --template 'mess {node|short} {rev} {desc}\n' -r 7 >> $EDITED | ||||
$ hg log --template 'pick {node|short} {rev} {desc}\n' -r 5 >> $EDITED | ||||
$ hg log --template 'pick {node|short} {rev} {desc}\n' -r 6 >> $EDITED | ||||
$ cat $EDITED | ||||
pick 65a9a84f33fd 3 c | ||||
pick 00f1c5383965 4 d | ||||
mess 39522b764e3d 7 does not commute with e | ||||
pick 7b4e2f4b7bcd 5 e | ||||
pick 500cac37a696 6 f | ||||
|
r17085 | |||
edit the history, this time with a fold action | ||||
|
r19019 | $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle | ||
|
r17646 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
|
r17647 | merging e | ||
warning: conflicts during merge. | ||||
merging e incomplete! (edit conflicts, then use 'hg resolve --mark') | ||||
|
r18934 | Fix up the change and run hg histedit --continue | ||
|
r17085 | |||
|
r17646 | $ echo 'I can haz no commute' > e | ||
|
r17647 | $ hg resolve --mark e | ||
|
r21267 | no more unresolved files | ||
|
r19020 | $ hg histedit --continue 2>&1 | fixbundle | ||
|
r17085 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
|
r17647 | merging e | ||
warning: conflicts during merge. | ||||
merging e incomplete! (edit conflicts, then use 'hg resolve --mark') | ||||
|
r18934 | Fix up the change and run hg histedit --continue | ||
|
r17085 | second edit also fails, but just continue | ||
|
r17647 | $ hg revert -r 'p1()' e | ||
$ hg resolve --mark e | ||||
|
r21267 | no more unresolved files | ||
|
r17085 | $ 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 | ||||
|
r19019 | @ changeset: 6:7efe1373e4bc | ||
|
r17085 | | tag: tip | ||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: f | ||||
| | ||||
|
r19019 | o changeset: 5:e334d87a1e55 | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
|
r19019 | | summary: does not commute with e | ||
|
r17085 | | | ||
|
r17646 | o changeset: 4:00f1c5383965 | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: d | ||||
| | ||||
|
r17646 | o changeset: 3:65a9a84f33fd | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: c | ||||
| | ||||
|
r17646 | o changeset: 2:da6535b52e45 | ||
|
r17085 | | user: test | ||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: b | ||||
| | ||||
|
r17646 | o changeset: 1:c1f09da44841 | ||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: a | ||||
| | ||||
o changeset: 0:1715188a53c7 | ||||
|
r17085 | user: test | ||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
|
r17646 | summary: Initial commit | ||
|
r17085 | |||
$ cd .. | ||||