test-histedit-fold-non-commute.t
342 lines
| 8.5 KiB
| text/troff
|
Tads3Lexer
/ tests / test-histedit-fold-non-commute.t
Mads Kiilerich
|
r17085 | $ . "$TESTDIR/histedit-helpers.sh" | ||
$ cat >> $HGRCPATH <<EOF | ||||
> [extensions] | ||||
> histedit= | ||||
> EOF | ||||
Ben Schmidt
|
r31055 | $ modwithdate () | ||
> { | ||||
> echo $1 > $1 | ||||
> hg ci -m $1 -d "$2 0" | ||||
> } | ||||
Mads Kiilerich
|
r17085 | $ initrepo () | ||
> { | ||||
> hg init $1 | ||||
> cd $1 | ||||
> for x in a b c d e f ; do | ||||
Pierre-Yves David
|
r17646 | > echo $x$x$x$x$x > $x | ||
> hg add $x | ||||
> done | ||||
> hg ci -m 'Initial commit' | ||||
Ben Schmidt
|
r31055 | > modwithdate a 1 | ||
> modwithdate b 2 | ||||
> modwithdate c 3 | ||||
> modwithdate d 4 | ||||
> modwithdate e 5 | ||||
> modwithdate f 6 | ||||
Pierre-Yves David
|
r17646 | > echo 'I can haz no commute' > e | ||
Ben Schmidt
|
r31055 | > hg ci -m 'does not commute with e' -d '7 0' | ||
Mads Kiilerich
|
r17085 | > cd .. | ||
> } | ||||
$ initrepo r | ||||
$ cd r | ||||
Pierre-Yves David
|
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 'fold {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 | ||||
Ben Schmidt
|
r31055 | pick 092e4ce14829 3 c | ||
pick ae78f4c9d74f 4 d | ||||
fold 42abbb61bede 7 does not commute with e | ||||
pick 7f3755409b00 5 e | ||||
pick dd184f2faeb0 6 f | ||||
Mads Kiilerich
|
r17085 | |||
log before edit | ||||
$ hg log --graph | ||||
Ben Schmidt
|
r31055 | @ changeset: 7:42abbb61bede | ||
Mads Kiilerich
|
r17085 | | tag: tip | ||
| user: test | ||||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:07 1970 +0000 | ||
Mads Kiilerich
|
r17085 | | summary: does not commute with e | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 6:dd184f2faeb0 | ||
Mads Kiilerich
|
r17085 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:06 1970 +0000 | ||
Mads Kiilerich
|
r17085 | | summary: f | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 5:7f3755409b00 | ||
Mads Kiilerich
|
r17085 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:05 1970 +0000 | ||
Mads Kiilerich
|
r17085 | | summary: e | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 4:ae78f4c9d74f | ||
Mads Kiilerich
|
r17085 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:04 1970 +0000 | ||
Mads Kiilerich
|
r17085 | | summary: d | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 3:092e4ce14829 | ||
Mads Kiilerich
|
r17085 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:03 1970 +0000 | ||
Mads Kiilerich
|
r17085 | | summary: c | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 2:40ccdd8beb95 | ||
Mads Kiilerich
|
r17085 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:02 1970 +0000 | ||
Mads Kiilerich
|
r17085 | | summary: b | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 1:cd997a145b29 | ||
Pierre-Yves David
|
r17646 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:01 1970 +0000 | ||
Pierre-Yves David
|
r17646 | | summary: a | ||
| | ||||
o changeset: 0:1715188a53c7 | ||||
Mads Kiilerich
|
r17085 | user: test | ||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
Pierre-Yves David
|
r17646 | summary: Initial commit | ||
Mads Kiilerich
|
r17085 | |||
edit the history | ||||
Pierre-Yves David
|
r19019 | $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle | ||
Pierre-Yves David
|
r17647 | merging e | ||
Siddharth Agarwal
|
r26614 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') | ||
Ben Schmidt
|
r31055 | Fix up the change (fold 42abbb61bede) | ||
timeless
|
r27629 | (hg histedit --continue to resume) | ||
Mads Kiilerich
|
r17085 | |||
fix up | ||||
Pierre-Yves David
|
r17647 | $ echo 'I can haz no commute' > e | ||
$ hg resolve --mark e | ||||
Pierre-Yves David
|
r21947 | (no more unresolved files) | ||
timeless
|
r27627 | continue: hg histedit --continue | ||
timeless
|
r28339 | $ HGEDITOR=cat hg histedit --continue 2>&1 | fixbundle | grep -v '2 files removed' | ||
Mads Kiilerich
|
r17085 | d | ||
*** | ||||
does not commute with e | ||||
Patrick Mezard
|
r17241 | |||
Pierre-Yves David
|
r17644 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | ||
HG: Leave message empty to abort commit. | ||||
HG: -- | ||||
HG: user: test | ||||
HG: branch 'default' | ||||
HG: changed d | ||||
HG: changed e | ||||
Pierre-Yves David
|
r17647 | merging e | ||
Siddharth Agarwal
|
r26614 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') | ||
Ben Schmidt
|
r31055 | Fix up the change (pick 7f3755409b00) | ||
timeless
|
r27629 | (hg histedit --continue to resume) | ||
Mads Kiilerich
|
r17085 | |||
just continue this time | ||||
timeless
|
r28340 | keep the non-commuting change, and thus the pending change will be dropped | ||
Pierre-Yves David
|
r17647 | $ hg revert -r 'p1()' e | ||
$ hg resolve --mark e | ||||
Pierre-Yves David
|
r21947 | (no more unresolved files) | ||
timeless
|
r27627 | continue: hg histedit --continue | ||
timeless
|
r28340 | $ hg diff | ||
Mads Kiilerich
|
r17085 | $ hg histedit --continue 2>&1 | fixbundle | ||
Ben Schmidt
|
r31055 | 7f3755409b00: skipping changeset (no changes) | ||
Mads Kiilerich
|
r17085 | |||
log after edit | ||||
$ hg log --graph | ||||
Ben Schmidt
|
r31055 | @ changeset: 5:1300355b1a54 | ||
Mads Kiilerich
|
r17085 | | tag: tip | ||
| user: test | ||||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:06 1970 +0000 | ||
Mads Kiilerich
|
r17085 | | summary: f | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 4:e2ac33269083 | ||
Mads Kiilerich
|
r17085 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:07 1970 +0000 | ||
Mads Kiilerich
|
r17085 | | summary: d | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 3:092e4ce14829 | ||
Mads Kiilerich
|
r17085 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:03 1970 +0000 | ||
Mads Kiilerich
|
r17085 | | summary: c | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 2:40ccdd8beb95 | ||
Mads Kiilerich
|
r17085 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:02 1970 +0000 | ||
Mads Kiilerich
|
r17085 | | summary: b | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 1:cd997a145b29 | ||
Pierre-Yves David
|
r17646 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:01 1970 +0000 | ||
Pierre-Yves David
|
r17646 | | summary: a | ||
| | ||||
o changeset: 0:1715188a53c7 | ||||
Mads Kiilerich
|
r17085 | user: test | ||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
Pierre-Yves David
|
r17646 | summary: Initial commit | ||
Mads Kiilerich
|
r17085 | |||
contents of e | ||||
$ hg cat e | ||||
Pierre-Yves David
|
r17647 | I can haz no commute | ||
Mads Kiilerich
|
r17085 | |||
manifest | ||||
$ hg manifest | ||||
a | ||||
b | ||||
c | ||||
d | ||||
e | ||||
f | ||||
$ cd .. | ||||
Mike Edgar
|
r22152 | |||
Ben Schmidt
|
r31056 | Repeat test using "roll", not "fold". "roll" folds in changes but drops message and date | ||
Mike Edgar
|
r22152 | |||
$ initrepo r2 | ||||
$ cd r2 | ||||
Initial generation of the command files | ||||
$ EDITED="$TESTTMP/editedhistory.2" | ||||
$ 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 'roll {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 | ||||
Ben Schmidt
|
r31055 | pick 092e4ce14829 3 c | ||
pick ae78f4c9d74f 4 d | ||||
roll 42abbb61bede 7 does not commute with e | ||||
pick 7f3755409b00 5 e | ||||
pick dd184f2faeb0 6 f | ||||
Mike Edgar
|
r22152 | |||
log before edit | ||||
$ hg log --graph | ||||
Ben Schmidt
|
r31055 | @ changeset: 7:42abbb61bede | ||
Mike Edgar
|
r22152 | | tag: tip | ||
| user: test | ||||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:07 1970 +0000 | ||
Mike Edgar
|
r22152 | | summary: does not commute with e | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 6:dd184f2faeb0 | ||
Mike Edgar
|
r22152 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:06 1970 +0000 | ||
Mike Edgar
|
r22152 | | summary: f | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 5:7f3755409b00 | ||
Mike Edgar
|
r22152 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:05 1970 +0000 | ||
Mike Edgar
|
r22152 | | summary: e | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 4:ae78f4c9d74f | ||
Mike Edgar
|
r22152 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:04 1970 +0000 | ||
Mike Edgar
|
r22152 | | summary: d | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 3:092e4ce14829 | ||
Mike Edgar
|
r22152 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:03 1970 +0000 | ||
Mike Edgar
|
r22152 | | summary: c | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 2:40ccdd8beb95 | ||
Mike Edgar
|
r22152 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:02 1970 +0000 | ||
Mike Edgar
|
r22152 | | summary: b | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 1:cd997a145b29 | ||
Mike Edgar
|
r22152 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:01 1970 +0000 | ||
Mike Edgar
|
r22152 | | summary: a | ||
| | ||||
o changeset: 0:1715188a53c7 | ||||
user: test | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: Initial commit | ||||
edit the history | ||||
$ hg histedit 3 --commands $EDITED 2>&1 | fixbundle | ||||
merging e | ||||
Siddharth Agarwal
|
r26614 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') | ||
Ben Schmidt
|
r31055 | Fix up the change (roll 42abbb61bede) | ||
timeless
|
r27629 | (hg histedit --continue to resume) | ||
Mike Edgar
|
r22152 | |||
fix up | ||||
$ echo 'I can haz no commute' > e | ||||
$ hg resolve --mark e | ||||
(no more unresolved files) | ||||
timeless
|
r27627 | continue: hg histedit --continue | ||
Mike Edgar
|
r22152 | $ hg histedit --continue 2>&1 | fixbundle | grep -v '2 files removed' | ||
merging e | ||||
Siddharth Agarwal
|
r26614 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') | ||
Ben Schmidt
|
r31055 | Fix up the change (pick 7f3755409b00) | ||
timeless
|
r27629 | (hg histedit --continue to resume) | ||
Mike Edgar
|
r22152 | |||
just continue this time | ||||
$ hg revert -r 'p1()' e | ||||
$ hg resolve --mark e | ||||
(no more unresolved files) | ||||
timeless
|
r27627 | continue: hg histedit --continue | ||
Mike Edgar
|
r22152 | $ hg histedit --continue 2>&1 | fixbundle | ||
Ben Schmidt
|
r31055 | 7f3755409b00: skipping changeset (no changes) | ||
Mike Edgar
|
r22152 | |||
log after edit | ||||
$ hg log --graph | ||||
Ben Schmidt
|
r31056 | @ changeset: 5:b538bcb461be | ||
Mike Edgar
|
r22152 | | tag: tip | ||
| user: test | ||||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:06 1970 +0000 | ||
Mike Edgar
|
r22152 | | summary: f | ||
| | ||||
Ben Schmidt
|
r31056 | o changeset: 4:317e37cb6d66 | ||
Mike Edgar
|
r22152 | | user: test | ||
Ben Schmidt
|
r31056 | | date: Thu Jan 01 00:00:04 1970 +0000 | ||
Mike Edgar
|
r22152 | | summary: d | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 3:092e4ce14829 | ||
Mike Edgar
|
r22152 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:03 1970 +0000 | ||
Mike Edgar
|
r22152 | | summary: c | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 2:40ccdd8beb95 | ||
Mike Edgar
|
r22152 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:02 1970 +0000 | ||
Mike Edgar
|
r22152 | | summary: b | ||
| | ||||
Ben Schmidt
|
r31055 | o changeset: 1:cd997a145b29 | ||
Mike Edgar
|
r22152 | | user: test | ||
Ben Schmidt
|
r31055 | | date: Thu Jan 01 00:00:01 1970 +0000 | ||
Mike Edgar
|
r22152 | | summary: a | ||
| | ||||
o changeset: 0:1715188a53c7 | ||||
user: test | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: Initial commit | ||||
contents of e | ||||
$ hg cat e | ||||
I can haz no commute | ||||
manifest | ||||
$ hg manifest | ||||
a | ||||
b | ||||
c | ||||
d | ||||
e | ||||
f | ||||
description is taken from rollup target commit | ||||
$ hg log --debug --rev 4 | ||||
Ben Schmidt
|
r31056 | changeset: 4:317e37cb6d66c1c84628c00e5bf4c8c292831951 | ||
Mike Edgar
|
r22152 | phase: draft | ||
Ben Schmidt
|
r31055 | parent: 3:092e4ce14829f4974399ce4316d59f64ef0b6725 | ||
Mike Edgar
|
r22152 | parent: -1:0000000000000000000000000000000000000000 | ||
manifest: 4:b068a323d969f22af1296ec6a5ea9384cef437ac | ||||
user: test | ||||
Ben Schmidt
|
r31056 | date: Thu Jan 01 00:00:04 1970 +0000 | ||
Mike Edgar
|
r22152 | files: d e | ||
extra: branch=default | ||||
Ben Schmidt
|
r31055 | extra: histedit_source=ae78f4c9d74ffa4b6cb5045001c303fe9204e890,42abbb61bede6f4366fa1e74a664343e5d558a70 | ||
Mike Edgar
|
r22152 | description: | ||
d | ||||
done with repo r2 | ||||
$ cd .. | ||||