annotate tests/test-histedit-non-commute-abort.t @ 17647:d34ba4991188

histedit: replaces patching logic by merges The old and fragile patching logic is replaced by smart merges (as rebase and graft do). This should prevents some conflicts and smoother human resolution. For this purpose the "foldchanges" function is renamed to "applychanges" and handle a single revision only.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Fri, 21 Sep 2012 19:27:22 +0200
parents a79776f427b4
children 93f3a06b2035
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
1 $ . "$TESTDIR/histedit-helpers.sh"
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
2
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
3 $ cat >> $HGRCPATH <<EOF
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
4 > [extensions]
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
5 > graphlog=
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
6 > histedit=
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
7 > EOF
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
8
17087
a79776f427b4 tests: make histedit pass on Windows MSYS
Mads Kiilerich <mads@kiilerich.com>
parents: 17086
diff changeset
9 $ EDITED="$TESTTMP/editedhistory"
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
10 $ cat > $EDITED <<EOF
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
11 > pick 177f92b77385 c
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
12 > pick 055a42cdd887 d
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
13 > pick bfa474341cc9 does not commute with e
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
14 > pick e860deea161a e
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
15 > pick 652413bf663e f
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
16 > EOF
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
17 $ initrepo ()
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
18 > {
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
19 > hg init r
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
20 > cd r
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
21 > for x in a b c d e f ; do
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
22 > echo $x > $x
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
23 > hg add $x
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
24 > hg ci -m $x
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
25 > done
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
26 > echo a >> e
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
27 > hg ci -m 'does not commute with e'
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
28 > cd ..
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
29 > }
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
30
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
31 $ initrepo
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
32 $ cd r
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
33
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
34 log before edit
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
35 $ hg log --graph
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
36 @ changeset: 6:bfa474341cc9
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
37 | tag: tip
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
38 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
39 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
40 | summary: does not commute with e
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
41 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
42 o changeset: 5:652413bf663e
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
43 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
44 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
45 | summary: f
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
46 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
47 o changeset: 4:e860deea161a
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
48 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
49 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
50 | summary: e
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
51 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
52 o changeset: 3:055a42cdd887
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
53 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
54 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
55 | summary: d
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
56 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
57 o changeset: 2:177f92b77385
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
58 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
59 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
60 | summary: c
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
61 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
62 o changeset: 1:d2ae7f538514
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
63 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
64 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
65 | summary: b
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
66 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
67 o changeset: 0:cb9a9f314b8b
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
68 user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
69 date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
70 summary: a
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
71
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
72
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
73 edit the history
17086
5f2cacb715dc tests: make histedit tests more resilient to filesystem variation
Mads Kiilerich <mads@kiilerich.com>
parents: 17085
diff changeset
74 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
75 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
17647
d34ba4991188 histedit: replaces patching logic by merges
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17087
diff changeset
76 remote changed e which local deleted
d34ba4991188 histedit: replaces patching logic by merges
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17087
diff changeset
77 use (c)hanged version or leave (d)eleted? c
d34ba4991188 histedit: replaces patching logic by merges
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17087
diff changeset
78 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
d34ba4991188 histedit: replaces patching logic by merges
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17087
diff changeset
79 merging e
d34ba4991188 histedit: replaces patching logic by merges
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17087
diff changeset
80 warning: conflicts during merge.
d34ba4991188 histedit: replaces patching logic by merges
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17087
diff changeset
81 merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
82 abort: Fix up the change and run hg histedit --continue
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
83
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
84
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
85 abort the edit
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
86 $ hg histedit --abort 2>&1 | fixbundle
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
87 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
88
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
89 log after abort
17647
d34ba4991188 histedit: replaces patching logic by merges
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17087
diff changeset
90 $ hg resolve -l
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
91 $ hg log --graph
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
92 @ changeset: 6:bfa474341cc9
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
93 | tag: tip
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
94 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
95 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
96 | summary: does not commute with e
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
97 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
98 o changeset: 5:652413bf663e
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
99 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
100 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
101 | summary: f
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
102 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
103 o changeset: 4:e860deea161a
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
104 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
105 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
106 | summary: e
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
107 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
108 o changeset: 3:055a42cdd887
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
109 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
110 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
111 | summary: d
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
112 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
113 o changeset: 2:177f92b77385
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
114 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
115 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
116 | summary: c
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
117 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
118 o changeset: 1:d2ae7f538514
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
119 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
120 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
121 | summary: b
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
122 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
123 o changeset: 0:cb9a9f314b8b
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
124 user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
125 date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
126 summary: a
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
127
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
128
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
129 $ cd ..