##// END OF EJS Templates
histedit-test: ensure that non commute test will never commute...
histedit-test: ensure that non commute test will never commute The previous version would commute if using merge algorithm (to be accurate, merge will cleanly prompt the user during the merge). The new version create and initial commit with some content for all involved files en ensure all changes are a content changes of the first lines. This lead to guaranteed conflict when commuted.

File last commit:

r17646:d44731a3 default
r17646:d44731a3 default
Show More
test-histedit-fold-non-commute.t
181 lines | 4.4 KiB | text/troff | Tads3Lexer
/ tests / test-histedit-fold-non-commute.t
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 $ . "$TESTDIR/histedit-helpers.sh"
$ cat >> $HGRCPATH <<EOF
> [extensions]
> graphlog=
> histedit=
> EOF
$ initrepo ()
> {
> hg init $1
> cd $1
> for x in a b c d e f ; do
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
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
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 > echo $x > $x
> hg ci -m $x
> done
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 > echo 'I can haz no commute' > e
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 > hg ci -m 'does not commute with e'
> cd ..
> }
$ initrepo r
$ cd r
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
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
pick 65a9a84f33fd 3 c
pick 00f1c5383965 4 d
fold 39522b764e3d 7 does not commute with e
pick 7b4e2f4b7bcd 5 e
pick 500cac37a696 6 f
Mads Kiilerich
tests: convert histedit tests to .t...
r17085
log before edit
$ hg log --graph
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 @ changeset: 7:39522b764e3d
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 | tag: tip
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: does not commute with e
|
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 o changeset: 6:500cac37a696
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 | user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: f
|
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 o changeset: 5:7b4e2f4b7bcd
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 | user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: e
|
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 o changeset: 4:00f1c5383965
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 | user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: d
|
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 o changeset: 3:65a9a84f33fd
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 | user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: c
|
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 o changeset: 2:da6535b52e45
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 | user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: b
|
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 o changeset: 1:c1f09da44841
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: a
|
o changeset: 0:1715188a53c7
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 user: test
date: Thu Jan 01 00:00:00 1970 +0000
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 summary: Initial commit
Mads Kiilerich
tests: convert histedit tests to .t...
r17085
edit the history
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 3 2>&1 | fixbundle
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
patching file e
Hunk #1 FAILED at 0
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 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
$ cat > cat.py <<EOF
> import sys
> print open(sys.argv[1]).read()
> print
> print
> EOF
$ HGEDITOR="python cat.py" hg histedit --continue 2>&1 | fixbundle | grep -v '2 files removed'
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 d
***
does not commute with e
Patrick Mezard
histedit: end folding message with an LF...
r17241
Pierre-Yves David
histedit: fold in memory...
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
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 patching file e
Hunk #1 FAILED at 0
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 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
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 @ changeset: 5:45bd04206744
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 | tag: tip
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: f
|
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 o changeset: 4:abff6367c13a
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 | user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: d
|
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 o changeset: 3:65a9a84f33fd
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 | user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: c
|
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 o changeset: 2:da6535b52e45
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 | user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: b
|
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 o changeset: 1:c1f09da44841
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: a
|
o changeset: 0:1715188a53c7
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 user: test
date: Thu Jan 01 00:00:00 1970 +0000
Pierre-Yves David
histedit-test: ensure that non commute test will never commute...
r17646 summary: Initial commit
Mads Kiilerich
tests: convert histedit tests to .t...
r17085
contents of e
$ hg cat e
a
manifest
$ hg manifest
a
b
c
d
e
f
$ cd ..