##// END OF EJS Templates
tests: make histedit tests more resilient to filesystem variation...
Mads Kiilerich -
r17086:5f2cacb7 default
parent child Browse files
Show More
@@ -1,359 +1,359 b''
1 $ . "$TESTDIR/histedit-helpers.sh"
1 $ . "$TESTDIR/histedit-helpers.sh"
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > graphlog=
5 > graphlog=
6 > histedit=
6 > histedit=
7 > EOF
7 > EOF
8
8
9 $ EDITED=`pwd`/editedhistory
9 $ EDITED=`pwd`/editedhistory
10 $ cat > $EDITED <<EOF
10 $ cat > $EDITED <<EOF
11 > pick 177f92b77385 c
11 > pick 177f92b77385 c
12 > pick e860deea161a e
12 > pick e860deea161a e
13 > pick 652413bf663e f
13 > pick 652413bf663e f
14 > pick 055a42cdd887 d
14 > pick 055a42cdd887 d
15 > EOF
15 > EOF
16 $ initrepo ()
16 $ initrepo ()
17 > {
17 > {
18 > hg init r
18 > hg init r
19 > cd r
19 > cd r
20 > for x in a b c d e f ; do
20 > for x in a b c d e f ; do
21 > echo $x > $x
21 > echo $x > $x
22 > hg add $x
22 > hg add $x
23 > hg ci -m $x
23 > hg ci -m $x
24 > done
24 > done
25 > }
25 > }
26
26
27 $ initrepo
27 $ initrepo
28
28
29 log before edit
29 log before edit
30 $ hg log --graph
30 $ hg log --graph
31 @ changeset: 5:652413bf663e
31 @ changeset: 5:652413bf663e
32 | tag: tip
32 | tag: tip
33 | user: test
33 | user: test
34 | date: Thu Jan 01 00:00:00 1970 +0000
34 | date: Thu Jan 01 00:00:00 1970 +0000
35 | summary: f
35 | summary: f
36 |
36 |
37 o changeset: 4:e860deea161a
37 o changeset: 4:e860deea161a
38 | user: test
38 | user: test
39 | date: Thu Jan 01 00:00:00 1970 +0000
39 | date: Thu Jan 01 00:00:00 1970 +0000
40 | summary: e
40 | summary: e
41 |
41 |
42 o changeset: 3:055a42cdd887
42 o changeset: 3:055a42cdd887
43 | user: test
43 | user: test
44 | date: Thu Jan 01 00:00:00 1970 +0000
44 | date: Thu Jan 01 00:00:00 1970 +0000
45 | summary: d
45 | summary: d
46 |
46 |
47 o changeset: 2:177f92b77385
47 o changeset: 2:177f92b77385
48 | user: test
48 | user: test
49 | date: Thu Jan 01 00:00:00 1970 +0000
49 | date: Thu Jan 01 00:00:00 1970 +0000
50 | summary: c
50 | summary: c
51 |
51 |
52 o changeset: 1:d2ae7f538514
52 o changeset: 1:d2ae7f538514
53 | user: test
53 | user: test
54 | date: Thu Jan 01 00:00:00 1970 +0000
54 | date: Thu Jan 01 00:00:00 1970 +0000
55 | summary: b
55 | summary: b
56 |
56 |
57 o changeset: 0:cb9a9f314b8b
57 o changeset: 0:cb9a9f314b8b
58 user: test
58 user: test
59 date: Thu Jan 01 00:00:00 1970 +0000
59 date: Thu Jan 01 00:00:00 1970 +0000
60 summary: a
60 summary: a
61
61
62
62
63 show the edit commands offered
63 show the edit commands offered
64 $ HGEDITOR=cat hg histedit 177f92b77385
64 $ HGEDITOR=cat hg histedit 177f92b77385
65 pick 177f92b77385 2 c
65 pick 177f92b77385 2 c
66 pick 055a42cdd887 3 d
66 pick 055a42cdd887 3 d
67 pick e860deea161a 4 e
67 pick e860deea161a 4 e
68 pick 652413bf663e 5 f
68 pick 652413bf663e 5 f
69
69
70 # Edit history between 177f92b77385 and 652413bf663e
70 # Edit history between 177f92b77385 and 652413bf663e
71 #
71 #
72 # Commands:
72 # Commands:
73 # p, pick = use commit
73 # p, pick = use commit
74 # e, edit = use commit, but stop for amending
74 # e, edit = use commit, but stop for amending
75 # f, fold = use commit, but fold into previous commit (combines N and N-1)
75 # f, fold = use commit, but fold into previous commit (combines N and N-1)
76 # d, drop = remove commit from history
76 # d, drop = remove commit from history
77 # m, mess = edit message without changing commit content
77 # m, mess = edit message without changing commit content
78 #
78 #
79 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
79 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
80
80
81 edit the history
81 edit the history
82 $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
82 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
83 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
83 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
84 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
85 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
85 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
87
87
88 rules should end up in .hg/histedit-last-edit.txt:
88 rules should end up in .hg/histedit-last-edit.txt:
89 $ cat .hg/histedit-last-edit.txt
89 $ cat .hg/histedit-last-edit.txt
90 pick 177f92b77385 c
90 pick 177f92b77385 c
91 pick e860deea161a e
91 pick e860deea161a e
92 pick 652413bf663e f
92 pick 652413bf663e f
93 pick 055a42cdd887 d
93 pick 055a42cdd887 d
94
94
95 log after edit
95 log after edit
96 $ hg log --graph
96 $ hg log --graph
97 @ changeset: 5:853c68da763f
97 @ changeset: 5:853c68da763f
98 | tag: tip
98 | tag: tip
99 | user: test
99 | user: test
100 | date: Thu Jan 01 00:00:00 1970 +0000
100 | date: Thu Jan 01 00:00:00 1970 +0000
101 | summary: d
101 | summary: d
102 |
102 |
103 o changeset: 4:26f6a030ae82
103 o changeset: 4:26f6a030ae82
104 | user: test
104 | user: test
105 | date: Thu Jan 01 00:00:00 1970 +0000
105 | date: Thu Jan 01 00:00:00 1970 +0000
106 | summary: f
106 | summary: f
107 |
107 |
108 o changeset: 3:b069cc29fb22
108 o changeset: 3:b069cc29fb22
109 | user: test
109 | user: test
110 | date: Thu Jan 01 00:00:00 1970 +0000
110 | date: Thu Jan 01 00:00:00 1970 +0000
111 | summary: e
111 | summary: e
112 |
112 |
113 o changeset: 2:177f92b77385
113 o changeset: 2:177f92b77385
114 | user: test
114 | user: test
115 | date: Thu Jan 01 00:00:00 1970 +0000
115 | date: Thu Jan 01 00:00:00 1970 +0000
116 | summary: c
116 | summary: c
117 |
117 |
118 o changeset: 1:d2ae7f538514
118 o changeset: 1:d2ae7f538514
119 | user: test
119 | user: test
120 | date: Thu Jan 01 00:00:00 1970 +0000
120 | date: Thu Jan 01 00:00:00 1970 +0000
121 | summary: b
121 | summary: b
122 |
122 |
123 o changeset: 0:cb9a9f314b8b
123 o changeset: 0:cb9a9f314b8b
124 user: test
124 user: test
125 date: Thu Jan 01 00:00:00 1970 +0000
125 date: Thu Jan 01 00:00:00 1970 +0000
126 summary: a
126 summary: a
127
127
128
128
129 put things back
129 put things back
130
130
131 $ cat > $EDITED <<EOF
131 $ cat > $EDITED <<EOF
132 > pick 177f92b77385 c
132 > pick 177f92b77385 c
133 > pick 853c68da763f d
133 > pick 853c68da763f d
134 > pick b069cc29fb22 e
134 > pick b069cc29fb22 e
135 > pick 26f6a030ae82 f
135 > pick 26f6a030ae82 f
136 > EOF
136 > EOF
137 $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
137 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
138 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
138 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
139 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
139 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
142
142
143 $ hg log --graph
143 $ hg log --graph
144 @ changeset: 5:652413bf663e
144 @ changeset: 5:652413bf663e
145 | tag: tip
145 | tag: tip
146 | user: test
146 | user: test
147 | date: Thu Jan 01 00:00:00 1970 +0000
147 | date: Thu Jan 01 00:00:00 1970 +0000
148 | summary: f
148 | summary: f
149 |
149 |
150 o changeset: 4:e860deea161a
150 o changeset: 4:e860deea161a
151 | user: test
151 | user: test
152 | date: Thu Jan 01 00:00:00 1970 +0000
152 | date: Thu Jan 01 00:00:00 1970 +0000
153 | summary: e
153 | summary: e
154 |
154 |
155 o changeset: 3:055a42cdd887
155 o changeset: 3:055a42cdd887
156 | user: test
156 | user: test
157 | date: Thu Jan 01 00:00:00 1970 +0000
157 | date: Thu Jan 01 00:00:00 1970 +0000
158 | summary: d
158 | summary: d
159 |
159 |
160 o changeset: 2:177f92b77385
160 o changeset: 2:177f92b77385
161 | user: test
161 | user: test
162 | date: Thu Jan 01 00:00:00 1970 +0000
162 | date: Thu Jan 01 00:00:00 1970 +0000
163 | summary: c
163 | summary: c
164 |
164 |
165 o changeset: 1:d2ae7f538514
165 o changeset: 1:d2ae7f538514
166 | user: test
166 | user: test
167 | date: Thu Jan 01 00:00:00 1970 +0000
167 | date: Thu Jan 01 00:00:00 1970 +0000
168 | summary: b
168 | summary: b
169 |
169 |
170 o changeset: 0:cb9a9f314b8b
170 o changeset: 0:cb9a9f314b8b
171 user: test
171 user: test
172 date: Thu Jan 01 00:00:00 1970 +0000
172 date: Thu Jan 01 00:00:00 1970 +0000
173 summary: a
173 summary: a
174
174
175
175
176 slightly different this time
176 slightly different this time
177
177
178 $ cat > $EDITED <<EOF
178 $ cat > $EDITED <<EOF
179 > pick 055a42cdd887 d
179 > pick 055a42cdd887 d
180 > pick 652413bf663e f
180 > pick 652413bf663e f
181 > pick e860deea161a e
181 > pick e860deea161a e
182 > pick 177f92b77385 c
182 > pick 177f92b77385 c
183 > EOF
183 > EOF
184 $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
184 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
185 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
185 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
186 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
186 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
187 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
187 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
188 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
188 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
190 $ hg log --graph
190 $ hg log --graph
191 @ changeset: 5:99a62755c625
191 @ changeset: 5:99a62755c625
192 | tag: tip
192 | tag: tip
193 | user: test
193 | user: test
194 | date: Thu Jan 01 00:00:00 1970 +0000
194 | date: Thu Jan 01 00:00:00 1970 +0000
195 | summary: c
195 | summary: c
196 |
196 |
197 o changeset: 4:7c6fdd608667
197 o changeset: 4:7c6fdd608667
198 | user: test
198 | user: test
199 | date: Thu Jan 01 00:00:00 1970 +0000
199 | date: Thu Jan 01 00:00:00 1970 +0000
200 | summary: e
200 | summary: e
201 |
201 |
202 o changeset: 3:c4f52e213402
202 o changeset: 3:c4f52e213402
203 | user: test
203 | user: test
204 | date: Thu Jan 01 00:00:00 1970 +0000
204 | date: Thu Jan 01 00:00:00 1970 +0000
205 | summary: f
205 | summary: f
206 |
206 |
207 o changeset: 2:bfe4a5a76b37
207 o changeset: 2:bfe4a5a76b37
208 | user: test
208 | user: test
209 | date: Thu Jan 01 00:00:00 1970 +0000
209 | date: Thu Jan 01 00:00:00 1970 +0000
210 | summary: d
210 | summary: d
211 |
211 |
212 o changeset: 1:d2ae7f538514
212 o changeset: 1:d2ae7f538514
213 | user: test
213 | user: test
214 | date: Thu Jan 01 00:00:00 1970 +0000
214 | date: Thu Jan 01 00:00:00 1970 +0000
215 | summary: b
215 | summary: b
216 |
216 |
217 o changeset: 0:cb9a9f314b8b
217 o changeset: 0:cb9a9f314b8b
218 user: test
218 user: test
219 date: Thu Jan 01 00:00:00 1970 +0000
219 date: Thu Jan 01 00:00:00 1970 +0000
220 summary: a
220 summary: a
221
221
222
222
223 keep prevents stripping dead revs
223 keep prevents stripping dead revs
224 $ cat > $EDITED <<EOF
224 $ cat > $EDITED <<EOF
225 > pick bfe4a5a76b37 d
225 > pick bfe4a5a76b37 d
226 > pick c4f52e213402 f
226 > pick c4f52e213402 f
227 > pick 99a62755c625 c
227 > pick 99a62755c625 c
228 > pick 7c6fdd608667 e
228 > pick 7c6fdd608667 e
229 > EOF
229 > EOF
230 $ HGEDITOR="cat $EDITED > " hg histedit bfe4a5a76b37 --keep 2>&1 | fixbundle
230 $ HGEDITOR="cat \"$EDITED\" > " hg histedit bfe4a5a76b37 --keep 2>&1 | fixbundle
231 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
231 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
232 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
232 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
233 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
233 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
234 $ hg log --graph
234 $ hg log --graph
235 > cat > $EDITED <<EOF
235 > cat > $EDITED <<EOF
236 > pick 7c6fdd608667 e
236 > pick 7c6fdd608667 e
237 > pick 99a62755c625 c
237 > pick 99a62755c625 c
238 > EOF
238 > EOF
239 @ changeset: 7:99e266581538
239 @ changeset: 7:99e266581538
240 | tag: tip
240 | tag: tip
241 | user: test
241 | user: test
242 | date: Thu Jan 01 00:00:00 1970 +0000
242 | date: Thu Jan 01 00:00:00 1970 +0000
243 | summary: e
243 | summary: e
244 |
244 |
245 o changeset: 6:5ad36efb0653
245 o changeset: 6:5ad36efb0653
246 | parent: 3:c4f52e213402
246 | parent: 3:c4f52e213402
247 | user: test
247 | user: test
248 | date: Thu Jan 01 00:00:00 1970 +0000
248 | date: Thu Jan 01 00:00:00 1970 +0000
249 | summary: c
249 | summary: c
250 |
250 |
251 | o changeset: 5:99a62755c625
251 | o changeset: 5:99a62755c625
252 | | user: test
252 | | user: test
253 | | date: Thu Jan 01 00:00:00 1970 +0000
253 | | date: Thu Jan 01 00:00:00 1970 +0000
254 | | summary: c
254 | | summary: c
255 | |
255 | |
256 | o changeset: 4:7c6fdd608667
256 | o changeset: 4:7c6fdd608667
257 |/ user: test
257 |/ user: test
258 | date: Thu Jan 01 00:00:00 1970 +0000
258 | date: Thu Jan 01 00:00:00 1970 +0000
259 | summary: e
259 | summary: e
260 |
260 |
261 o changeset: 3:c4f52e213402
261 o changeset: 3:c4f52e213402
262 | user: test
262 | user: test
263 | date: Thu Jan 01 00:00:00 1970 +0000
263 | date: Thu Jan 01 00:00:00 1970 +0000
264 | summary: f
264 | summary: f
265 |
265 |
266 o changeset: 2:bfe4a5a76b37
266 o changeset: 2:bfe4a5a76b37
267 | user: test
267 | user: test
268 | date: Thu Jan 01 00:00:00 1970 +0000
268 | date: Thu Jan 01 00:00:00 1970 +0000
269 | summary: d
269 | summary: d
270 |
270 |
271 o changeset: 1:d2ae7f538514
271 o changeset: 1:d2ae7f538514
272 | user: test
272 | user: test
273 | date: Thu Jan 01 00:00:00 1970 +0000
273 | date: Thu Jan 01 00:00:00 1970 +0000
274 | summary: b
274 | summary: b
275 |
275 |
276 o changeset: 0:cb9a9f314b8b
276 o changeset: 0:cb9a9f314b8b
277 user: test
277 user: test
278 date: Thu Jan 01 00:00:00 1970 +0000
278 date: Thu Jan 01 00:00:00 1970 +0000
279 summary: a
279 summary: a
280
280
281
281
282 try with --rev
282 try with --rev
283 $ hg histedit --commands "$EDITED" --rev -2 2>&1 | fixbundle
283 $ hg histedit --commands "$EDITED" --rev -2 2>&1 | fixbundle
284 abort: may not use changesets other than the ones listed
284 abort: may not use changesets other than the ones listed
285 $ hg log --graph
285 $ hg log --graph
286 @ changeset: 7:99e266581538
286 @ changeset: 7:99e266581538
287 | tag: tip
287 | tag: tip
288 | user: test
288 | user: test
289 | date: Thu Jan 01 00:00:00 1970 +0000
289 | date: Thu Jan 01 00:00:00 1970 +0000
290 | summary: e
290 | summary: e
291 |
291 |
292 o changeset: 6:5ad36efb0653
292 o changeset: 6:5ad36efb0653
293 | parent: 3:c4f52e213402
293 | parent: 3:c4f52e213402
294 | user: test
294 | user: test
295 | date: Thu Jan 01 00:00:00 1970 +0000
295 | date: Thu Jan 01 00:00:00 1970 +0000
296 | summary: c
296 | summary: c
297 |
297 |
298 | o changeset: 5:99a62755c625
298 | o changeset: 5:99a62755c625
299 | | user: test
299 | | user: test
300 | | date: Thu Jan 01 00:00:00 1970 +0000
300 | | date: Thu Jan 01 00:00:00 1970 +0000
301 | | summary: c
301 | | summary: c
302 | |
302 | |
303 | o changeset: 4:7c6fdd608667
303 | o changeset: 4:7c6fdd608667
304 |/ user: test
304 |/ user: test
305 | date: Thu Jan 01 00:00:00 1970 +0000
305 | date: Thu Jan 01 00:00:00 1970 +0000
306 | summary: e
306 | summary: e
307 |
307 |
308 o changeset: 3:c4f52e213402
308 o changeset: 3:c4f52e213402
309 | user: test
309 | user: test
310 | date: Thu Jan 01 00:00:00 1970 +0000
310 | date: Thu Jan 01 00:00:00 1970 +0000
311 | summary: f
311 | summary: f
312 |
312 |
313 o changeset: 2:bfe4a5a76b37
313 o changeset: 2:bfe4a5a76b37
314 | user: test
314 | user: test
315 | date: Thu Jan 01 00:00:00 1970 +0000
315 | date: Thu Jan 01 00:00:00 1970 +0000
316 | summary: d
316 | summary: d
317 |
317 |
318 o changeset: 1:d2ae7f538514
318 o changeset: 1:d2ae7f538514
319 | user: test
319 | user: test
320 | date: Thu Jan 01 00:00:00 1970 +0000
320 | date: Thu Jan 01 00:00:00 1970 +0000
321 | summary: b
321 | summary: b
322 |
322 |
323 o changeset: 0:cb9a9f314b8b
323 o changeset: 0:cb9a9f314b8b
324 user: test
324 user: test
325 date: Thu Jan 01 00:00:00 1970 +0000
325 date: Thu Jan 01 00:00:00 1970 +0000
326 summary: a
326 summary: a
327
327
328
328
329 should also work if a commit message is missing
329 should also work if a commit message is missing
330 $ BUNDLE="$TESTDIR/missing-comment.hg"
330 $ BUNDLE="$TESTDIR/missing-comment.hg"
331 $ hg init missing
331 $ hg init missing
332 $ cd missing
332 $ cd missing
333 $ hg unbundle $BUNDLE
333 $ hg unbundle $BUNDLE
334 adding changesets
334 adding changesets
335 adding manifests
335 adding manifests
336 adding file changes
336 adding file changes
337 added 3 changesets with 3 changes to 1 files
337 added 3 changesets with 3 changes to 1 files
338 (run 'hg update' to get a working copy)
338 (run 'hg update' to get a working copy)
339 $ hg co tip
339 $ hg co tip
340 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
340 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
341 $ hg log --graph
341 $ hg log --graph
342 @ changeset: 2:bd22688093b3
342 @ changeset: 2:bd22688093b3
343 | tag: tip
343 | tag: tip
344 | user: Robert Altman <robert.altman@telventDTN.com>
344 | user: Robert Altman <robert.altman@telventDTN.com>
345 | date: Mon Nov 28 16:40:04 2011 +0000
345 | date: Mon Nov 28 16:40:04 2011 +0000
346 | summary: Update file.
346 | summary: Update file.
347 |
347 |
348 o changeset: 1:3b3e956f9171
348 o changeset: 1:3b3e956f9171
349 | user: Robert Altman <robert.altman@telventDTN.com>
349 | user: Robert Altman <robert.altman@telventDTN.com>
350 | date: Mon Nov 28 16:37:57 2011 +0000
350 | date: Mon Nov 28 16:37:57 2011 +0000
351 |
351 |
352 o changeset: 0:141947992243
352 o changeset: 0:141947992243
353 user: Robert Altman <robert.altman@telventDTN.com>
353 user: Robert Altman <robert.altman@telventDTN.com>
354 date: Mon Nov 28 16:35:28 2011 +0000
354 date: Mon Nov 28 16:35:28 2011 +0000
355 summary: Checked in text file
355 summary: Checked in text file
356
356
357 $ hg histedit 0
357 $ hg histedit 0
358 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
358 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
359 $ cd ..
359 $ cd ..
@@ -1,107 +1,107 b''
1 $ . "$TESTDIR/histedit-helpers.sh"
1 $ . "$TESTDIR/histedit-helpers.sh"
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > graphlog=
5 > graphlog=
6 > histedit=
6 > histedit=
7 > EOF
7 > EOF
8
8
9 $ EDITED=`pwd`/editedhistory
9 $ EDITED=`pwd`/editedhistory
10 $ cat > $EDITED <<EOF
10 $ cat > $EDITED <<EOF
11 > drop 177f92b77385 c
11 > drop 177f92b77385 c
12 > pick e860deea161a e
12 > pick e860deea161a e
13 > pick 652413bf663e f
13 > pick 652413bf663e f
14 > pick 055a42cdd887 d
14 > pick 055a42cdd887 d
15 > EOF
15 > EOF
16 $ initrepo ()
16 $ initrepo ()
17 > {
17 > {
18 > hg init r
18 > hg init r
19 > cd r
19 > cd r
20 > for x in a b c d e f ; do
20 > for x in a b c d e f ; do
21 > echo $x > $x
21 > echo $x > $x
22 > hg add $x
22 > hg add $x
23 > hg ci -m $x
23 > hg ci -m $x
24 > done
24 > done
25 > }
25 > }
26
26
27 $ initrepo
27 $ initrepo
28
28
29 log before edit
29 log before edit
30 $ hg log --graph
30 $ hg log --graph
31 @ changeset: 5:652413bf663e
31 @ changeset: 5:652413bf663e
32 | tag: tip
32 | tag: tip
33 | user: test
33 | user: test
34 | date: Thu Jan 01 00:00:00 1970 +0000
34 | date: Thu Jan 01 00:00:00 1970 +0000
35 | summary: f
35 | summary: f
36 |
36 |
37 o changeset: 4:e860deea161a
37 o changeset: 4:e860deea161a
38 | user: test
38 | user: test
39 | date: Thu Jan 01 00:00:00 1970 +0000
39 | date: Thu Jan 01 00:00:00 1970 +0000
40 | summary: e
40 | summary: e
41 |
41 |
42 o changeset: 3:055a42cdd887
42 o changeset: 3:055a42cdd887
43 | user: test
43 | user: test
44 | date: Thu Jan 01 00:00:00 1970 +0000
44 | date: Thu Jan 01 00:00:00 1970 +0000
45 | summary: d
45 | summary: d
46 |
46 |
47 o changeset: 2:177f92b77385
47 o changeset: 2:177f92b77385
48 | user: test
48 | user: test
49 | date: Thu Jan 01 00:00:00 1970 +0000
49 | date: Thu Jan 01 00:00:00 1970 +0000
50 | summary: c
50 | summary: c
51 |
51 |
52 o changeset: 1:d2ae7f538514
52 o changeset: 1:d2ae7f538514
53 | user: test
53 | user: test
54 | date: Thu Jan 01 00:00:00 1970 +0000
54 | date: Thu Jan 01 00:00:00 1970 +0000
55 | summary: b
55 | summary: b
56 |
56 |
57 o changeset: 0:cb9a9f314b8b
57 o changeset: 0:cb9a9f314b8b
58 user: test
58 user: test
59 date: Thu Jan 01 00:00:00 1970 +0000
59 date: Thu Jan 01 00:00:00 1970 +0000
60 summary: a
60 summary: a
61
61
62
62
63 edit the history
63 edit the history
64 $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
64 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
65 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
65 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
66 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
66 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
67 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
67 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
69
69
70 log after edit
70 log after edit
71 $ hg log --graph
71 $ hg log --graph
72 @ changeset: 4:708943196e52
72 @ changeset: 4:708943196e52
73 | tag: tip
73 | tag: tip
74 | user: test
74 | user: test
75 | date: Thu Jan 01 00:00:00 1970 +0000
75 | date: Thu Jan 01 00:00:00 1970 +0000
76 | summary: d
76 | summary: d
77 |
77 |
78 o changeset: 3:75cbdffecadb
78 o changeset: 3:75cbdffecadb
79 | user: test
79 | user: test
80 | date: Thu Jan 01 00:00:00 1970 +0000
80 | date: Thu Jan 01 00:00:00 1970 +0000
81 | summary: f
81 | summary: f
82 |
82 |
83 o changeset: 2:493dc0964412
83 o changeset: 2:493dc0964412
84 | user: test
84 | user: test
85 | date: Thu Jan 01 00:00:00 1970 +0000
85 | date: Thu Jan 01 00:00:00 1970 +0000
86 | summary: e
86 | summary: e
87 |
87 |
88 o changeset: 1:d2ae7f538514
88 o changeset: 1:d2ae7f538514
89 | user: test
89 | user: test
90 | date: Thu Jan 01 00:00:00 1970 +0000
90 | date: Thu Jan 01 00:00:00 1970 +0000
91 | summary: b
91 | summary: b
92 |
92 |
93 o changeset: 0:cb9a9f314b8b
93 o changeset: 0:cb9a9f314b8b
94 user: test
94 user: test
95 date: Thu Jan 01 00:00:00 1970 +0000
95 date: Thu Jan 01 00:00:00 1970 +0000
96 summary: a
96 summary: a
97
97
98
98
99 manifest after edit
99 manifest after edit
100 $ hg manifest
100 $ hg manifest
101 a
101 a
102 b
102 b
103 d
103 d
104 e
104 e
105 f
105 f
106
106
107 $ cd ..
107 $ cd ..
@@ -1,180 +1,178 b''
1 $ . "$TESTDIR/histedit-helpers.sh"
1 $ . "$TESTDIR/histedit-helpers.sh"
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > graphlog=
5 > graphlog=
6 > histedit=
6 > histedit=
7 > EOF
7 > EOF
8
8
9 $ EDITED=`pwd`/editedhistory
9 $ EDITED=`pwd`/editedhistory
10 $ cat > $EDITED <<EOF
10 $ cat > $EDITED <<EOF
11 > pick 177f92b77385 c
11 > pick 177f92b77385 c
12 > pick 055a42cdd887 d
12 > pick 055a42cdd887 d
13 > edit e860deea161a e
13 > edit e860deea161a e
14 > pick 652413bf663e f
14 > pick 652413bf663e f
15 > EOF
15 > EOF
16 $ initrepo ()
16 $ initrepo ()
17 > {
17 > {
18 > hg init r
18 > hg init r
19 > cd r
19 > cd r
20 > for x in a b c d e f ; do
20 > for x in a b c d e f ; do
21 > echo $x > $x
21 > echo $x > $x
22 > hg add $x
22 > hg add $x
23 > hg ci -m $x
23 > hg ci -m $x
24 > done
24 > done
25 > }
25 > }
26
26
27 $ initrepo
27 $ initrepo
28
28
29 log before edit
29 log before edit
30 $ hg log --graph
30 $ hg log --graph
31 @ changeset: 5:652413bf663e
31 @ changeset: 5:652413bf663e
32 | tag: tip
32 | tag: tip
33 | user: test
33 | user: test
34 | date: Thu Jan 01 00:00:00 1970 +0000
34 | date: Thu Jan 01 00:00:00 1970 +0000
35 | summary: f
35 | summary: f
36 |
36 |
37 o changeset: 4:e860deea161a
37 o changeset: 4:e860deea161a
38 | user: test
38 | user: test
39 | date: Thu Jan 01 00:00:00 1970 +0000
39 | date: Thu Jan 01 00:00:00 1970 +0000
40 | summary: e
40 | summary: e
41 |
41 |
42 o changeset: 3:055a42cdd887
42 o changeset: 3:055a42cdd887
43 | user: test
43 | user: test
44 | date: Thu Jan 01 00:00:00 1970 +0000
44 | date: Thu Jan 01 00:00:00 1970 +0000
45 | summary: d
45 | summary: d
46 |
46 |
47 o changeset: 2:177f92b77385
47 o changeset: 2:177f92b77385
48 | user: test
48 | user: test
49 | date: Thu Jan 01 00:00:00 1970 +0000
49 | date: Thu Jan 01 00:00:00 1970 +0000
50 | summary: c
50 | summary: c
51 |
51 |
52 o changeset: 1:d2ae7f538514
52 o changeset: 1:d2ae7f538514
53 | user: test
53 | user: test
54 | date: Thu Jan 01 00:00:00 1970 +0000
54 | date: Thu Jan 01 00:00:00 1970 +0000
55 | summary: b
55 | summary: b
56 |
56 |
57 o changeset: 0:cb9a9f314b8b
57 o changeset: 0:cb9a9f314b8b
58 user: test
58 user: test
59 date: Thu Jan 01 00:00:00 1970 +0000
59 date: Thu Jan 01 00:00:00 1970 +0000
60 summary: a
60 summary: a
61
61
62
62
63 edit the history
63 edit the history
64 $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
64 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
65 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
65 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
66 abort: Make changes as needed, you may commit or record as needed now.
66 abort: Make changes as needed, you may commit or record as needed now.
67 When you are finished, run hg histedit --continue to resume.
67 When you are finished, run hg histedit --continue to resume.
68
68
69 commit, then edit the revision
69 commit, then edit the revision
70 $ hg ci -m 'wat'
70 $ hg ci -m 'wat'
71 created new head
71 created new head
72 $ echo a > e
72 $ echo a > e
73 $ HGEDITOR='echo "foobaz" > ' hg histedit --continue 2>&1 | fixbundle
73 $ HGEDITOR='echo "foobaz" > ' hg histedit --continue 2>&1 | fixbundle
74 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
76
76
77 $ hg log --graph
77 $ hg log --graph
78 @ changeset: 6:bf757c081cd0
78 @ changeset: 6:bf757c081cd0
79 | tag: tip
79 | tag: tip
80 | user: test
80 | user: test
81 | date: Thu Jan 01 00:00:00 1970 +0000
81 | date: Thu Jan 01 00:00:00 1970 +0000
82 | summary: f
82 | summary: f
83 |
83 |
84 o changeset: 5:d6b15fed32d4
84 o changeset: 5:d6b15fed32d4
85 | user: test
85 | user: test
86 | date: Thu Jan 01 00:00:00 1970 +0000
86 | date: Thu Jan 01 00:00:00 1970 +0000
87 | summary: foobaz
87 | summary: foobaz
88 |
88 |
89 o changeset: 4:1a60820cd1f6
89 o changeset: 4:1a60820cd1f6
90 | user: test
90 | user: test
91 | date: Thu Jan 01 00:00:00 1970 +0000
91 | date: Thu Jan 01 00:00:00 1970 +0000
92 | summary: wat
92 | summary: wat
93 |
93 |
94 o changeset: 3:055a42cdd887
94 o changeset: 3:055a42cdd887
95 | user: test
95 | user: test
96 | date: Thu Jan 01 00:00:00 1970 +0000
96 | date: Thu Jan 01 00:00:00 1970 +0000
97 | summary: d
97 | summary: d
98 |
98 |
99 o changeset: 2:177f92b77385
99 o changeset: 2:177f92b77385
100 | user: test
100 | user: test
101 | date: Thu Jan 01 00:00:00 1970 +0000
101 | date: Thu Jan 01 00:00:00 1970 +0000
102 | summary: c
102 | summary: c
103 |
103 |
104 o changeset: 1:d2ae7f538514
104 o changeset: 1:d2ae7f538514
105 | user: test
105 | user: test
106 | date: Thu Jan 01 00:00:00 1970 +0000
106 | date: Thu Jan 01 00:00:00 1970 +0000
107 | summary: b
107 | summary: b
108 |
108 |
109 o changeset: 0:cb9a9f314b8b
109 o changeset: 0:cb9a9f314b8b
110 user: test
110 user: test
111 date: Thu Jan 01 00:00:00 1970 +0000
111 date: Thu Jan 01 00:00:00 1970 +0000
112 summary: a
112 summary: a
113
113
114
114
115 $ hg cat e
115 $ hg cat e
116 a
116 a
117
117
118 $ cat > $EDITED <<EOF
118 $ cat > $EDITED <<EOF
119 > edit bf757c081cd0 f
119 > edit bf757c081cd0 f
120 > EOF
120 > EOF
121 $ HGEDITOR="cat $EDITED > " hg histedit tip 2>&1 | fixbundle
121 $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle
122 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
122 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
123 abort: Make changes as needed, you may commit or record as needed now.
123 abort: Make changes as needed, you may commit or record as needed now.
124 When you are finished, run hg histedit --continue to resume.
124 When you are finished, run hg histedit --continue to resume.
125 $ hg status
125 $ hg status
126 A f
126 A f
127 $ HGEDITOR='true' hg histedit --continue
127 $ HGEDITOR='true' hg histedit --continue
128 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
128 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
129 $ hg status
129 $ hg status
130
130
131 log after edit
131 log after edit
132 $ hg log --limit 1
132 $ hg log --limit 1
133 changeset: 6:bf757c081cd0
133 changeset: 6:bf757c081cd0
134 tag: tip
134 tag: tip
135 user: test
135 user: test
136 date: Thu Jan 01 00:00:00 1970 +0000
136 date: Thu Jan 01 00:00:00 1970 +0000
137 summary: f
137 summary: f
138
138
139
139
140 say we'll change the message, but don't.
140 say we'll change the message, but don't.
141 $ cat > ../edit.sh <<EOF
141 $ cat > ../edit.sh <<EOF
142 > #!/bin/sh
142 > cat "\$1" | sed s/pick/mess/ > tmp
143 > cat \$1 | sed s/pick/mess/ > tmp
143 > mv tmp "\$1"
144 > mv tmp \$1
145 > EOF
144 > EOF
146 $ chmod +x ../edit.sh
145 $ HGEDITOR="sh ../edit.sh" hg histedit tip 2>&1 | fixbundle
147 $ HGEDITOR="../edit.sh" hg histedit tip 2>&1 | fixbundle
148 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
146 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
149 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
147 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
150 $ hg status
148 $ hg status
151 $ hg log --limit 1
149 $ hg log --limit 1
152 changeset: 6:bf757c081cd0
150 changeset: 6:bf757c081cd0
153 tag: tip
151 tag: tip
154 user: test
152 user: test
155 date: Thu Jan 01 00:00:00 1970 +0000
153 date: Thu Jan 01 00:00:00 1970 +0000
156 summary: f
154 summary: f
157
155
158
156
159 modify the message
157 modify the message
160 $ cat > $EDITED <<EOF
158 $ cat > $EDITED <<EOF
161 > mess bf757c081cd0 f
159 > mess bf757c081cd0 f
162 > EOF
160 > EOF
163 $ HGEDITOR="cat $EDITED > " hg histedit tip 2>&1 | fixbundle
161 $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle
164 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
162 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
165 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
163 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
166 $ hg status
164 $ hg status
167 $ hg log --limit 1
165 $ hg log --limit 1
168 changeset: 6:0b16746f8e89
166 changeset: 6:0b16746f8e89
169 tag: tip
167 tag: tip
170 user: test
168 user: test
171 date: Thu Jan 01 00:00:00 1970 +0000
169 date: Thu Jan 01 00:00:00 1970 +0000
172 summary: mess bf757c081cd0 f
170 summary: mess bf757c081cd0 f
173
171
174
172
175 rollback should not work after a histedit
173 rollback should not work after a histedit
176 $ hg rollback
174 $ hg rollback
177 no rollback information available
175 no rollback information available
178 [1]
176 [1]
179
177
180 $ cd ..
178 $ cd ..
@@ -1,146 +1,146 b''
1 $ . "$TESTDIR/histedit-helpers.sh"
1 $ . "$TESTDIR/histedit-helpers.sh"
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > graphlog=
5 > graphlog=
6 > histedit=
6 > histedit=
7 > EOF
7 > EOF
8
8
9 $ EDITED=`pwd`/editedhistory
9 $ EDITED=`pwd`/editedhistory
10 $ cat > $EDITED <<EOF
10 $ cat > $EDITED <<EOF
11 > pick 177f92b77385 c
11 > pick 177f92b77385 c
12 > pick 055a42cdd887 d
12 > pick 055a42cdd887 d
13 > fold bfa474341cc9 does not commute with e
13 > fold bfa474341cc9 does not commute with e
14 > pick e860deea161a e
14 > pick e860deea161a e
15 > pick 652413bf663e f
15 > pick 652413bf663e f
16 > EOF
16 > EOF
17 $ initrepo ()
17 $ initrepo ()
18 > {
18 > {
19 > hg init $1
19 > hg init $1
20 > cd $1
20 > cd $1
21 > for x in a b c d e f ; do
21 > for x in a b c d e f ; do
22 > echo $x > $x
22 > echo $x > $x
23 > hg add $x
23 > hg add $x
24 > hg ci -m $x
24 > hg ci -m $x
25 > done
25 > done
26 > echo a >> e
26 > echo a >> e
27 > hg ci -m 'does not commute with e'
27 > hg ci -m 'does not commute with e'
28 > cd ..
28 > cd ..
29 > }
29 > }
30
30
31 $ initrepo r
31 $ initrepo r
32 $ cd r
32 $ cd r
33
33
34 log before edit
34 log before edit
35 $ hg log --graph
35 $ hg log --graph
36 @ changeset: 6:bfa474341cc9
36 @ changeset: 6:bfa474341cc9
37 | tag: tip
37 | tag: tip
38 | user: test
38 | user: test
39 | date: Thu Jan 01 00:00:00 1970 +0000
39 | date: Thu Jan 01 00:00:00 1970 +0000
40 | summary: does not commute with e
40 | summary: does not commute with e
41 |
41 |
42 o changeset: 5:652413bf663e
42 o changeset: 5:652413bf663e
43 | user: test
43 | user: test
44 | date: Thu Jan 01 00:00:00 1970 +0000
44 | date: Thu Jan 01 00:00:00 1970 +0000
45 | summary: f
45 | summary: f
46 |
46 |
47 o changeset: 4:e860deea161a
47 o changeset: 4:e860deea161a
48 | user: test
48 | user: test
49 | date: Thu Jan 01 00:00:00 1970 +0000
49 | date: Thu Jan 01 00:00:00 1970 +0000
50 | summary: e
50 | summary: e
51 |
51 |
52 o changeset: 3:055a42cdd887
52 o changeset: 3:055a42cdd887
53 | user: test
53 | user: test
54 | date: Thu Jan 01 00:00:00 1970 +0000
54 | date: Thu Jan 01 00:00:00 1970 +0000
55 | summary: d
55 | summary: d
56 |
56 |
57 o changeset: 2:177f92b77385
57 o changeset: 2:177f92b77385
58 | user: test
58 | user: test
59 | date: Thu Jan 01 00:00:00 1970 +0000
59 | date: Thu Jan 01 00:00:00 1970 +0000
60 | summary: c
60 | summary: c
61 |
61 |
62 o changeset: 1:d2ae7f538514
62 o changeset: 1:d2ae7f538514
63 | user: test
63 | user: test
64 | date: Thu Jan 01 00:00:00 1970 +0000
64 | date: Thu Jan 01 00:00:00 1970 +0000
65 | summary: b
65 | summary: b
66 |
66 |
67 o changeset: 0:cb9a9f314b8b
67 o changeset: 0:cb9a9f314b8b
68 user: test
68 user: test
69 date: Thu Jan 01 00:00:00 1970 +0000
69 date: Thu Jan 01 00:00:00 1970 +0000
70 summary: a
70 summary: a
71
71
72
72
73 edit the history
73 edit the history
74 $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
74 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
75 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
75 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
76 1 out of 1 hunks FAILED -- saving rejects to file e.rej
76 1 out of 1 hunks FAILED -- saving rejects to file e.rej
77 abort: Fix up the change and run hg histedit --continue
77 abort: Fix up the change and run hg histedit --continue
78
78
79 fix up
79 fix up
80 $ echo a > e
80 $ echo a > e
81 $ hg add e
81 $ hg add e
82 $ cat > cat.py <<EOF
82 $ cat > cat.py <<EOF
83 > import sys
83 > import sys
84 > print open(sys.argv[1]).read()
84 > print open(sys.argv[1]).read()
85 > print
85 > print
86 > print
86 > print
87 > EOF
87 > EOF
88 $ HGEDITOR="python cat.py" hg histedit --continue 2>&1 | fixbundle | grep -v '2 files removed'
88 $ HGEDITOR="python cat.py" hg histedit --continue 2>&1 | fixbundle | grep -v '2 files removed'
89 d
89 d
90 ***
90 ***
91 does not commute with e
91 does not commute with e
92
92
93
93
94 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
94 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
95 file e already exists
95 file e already exists
96 1 out of 1 hunks FAILED -- saving rejects to file e.rej
96 1 out of 1 hunks FAILED -- saving rejects to file e.rej
97 abort: Fix up the change and run hg histedit --continue
97 abort: Fix up the change and run hg histedit --continue
98
98
99 just continue this time
99 just continue this time
100 $ hg histedit --continue 2>&1 | fixbundle
100 $ hg histedit --continue 2>&1 | fixbundle
101 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
102 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
102 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
103
103
104 log after edit
104 log after edit
105 $ hg log --graph
105 $ hg log --graph
106 @ changeset: 4:f768fd60ca34
106 @ changeset: 4:f768fd60ca34
107 | tag: tip
107 | tag: tip
108 | user: test
108 | user: test
109 | date: Thu Jan 01 00:00:00 1970 +0000
109 | date: Thu Jan 01 00:00:00 1970 +0000
110 | summary: f
110 | summary: f
111 |
111 |
112 o changeset: 3:671efe372e33
112 o changeset: 3:671efe372e33
113 | user: test
113 | user: test
114 | date: Thu Jan 01 00:00:00 1970 +0000
114 | date: Thu Jan 01 00:00:00 1970 +0000
115 | summary: d
115 | summary: d
116 |
116 |
117 o changeset: 2:177f92b77385
117 o changeset: 2:177f92b77385
118 | user: test
118 | user: test
119 | date: Thu Jan 01 00:00:00 1970 +0000
119 | date: Thu Jan 01 00:00:00 1970 +0000
120 | summary: c
120 | summary: c
121 |
121 |
122 o changeset: 1:d2ae7f538514
122 o changeset: 1:d2ae7f538514
123 | user: test
123 | user: test
124 | date: Thu Jan 01 00:00:00 1970 +0000
124 | date: Thu Jan 01 00:00:00 1970 +0000
125 | summary: b
125 | summary: b
126 |
126 |
127 o changeset: 0:cb9a9f314b8b
127 o changeset: 0:cb9a9f314b8b
128 user: test
128 user: test
129 date: Thu Jan 01 00:00:00 1970 +0000
129 date: Thu Jan 01 00:00:00 1970 +0000
130 summary: a
130 summary: a
131
131
132
132
133 contents of e
133 contents of e
134 $ hg cat e
134 $ hg cat e
135 a
135 a
136
136
137 manifest
137 manifest
138 $ hg manifest
138 $ hg manifest
139 a
139 a
140 b
140 b
141 c
141 c
142 d
142 d
143 e
143 e
144 f
144 f
145
145
146 $ cd ..
146 $ cd ..
@@ -1,110 +1,110 b''
1 $ . "$TESTDIR/histedit-helpers.sh"
1 $ . "$TESTDIR/histedit-helpers.sh"
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > graphlog=
5 > graphlog=
6 > histedit=
6 > histedit=
7 > EOF
7 > EOF
8
8
9 $ EDITED=`pwd`/editedhistory
9 $ EDITED=`pwd`/editedhistory
10 $ cat > $EDITED <<EOF
10 $ cat > $EDITED <<EOF
11 > pick e860deea161a e
11 > pick e860deea161a e
12 > pick 652413bf663e f
12 > pick 652413bf663e f
13 > fold 177f92b77385 c
13 > fold 177f92b77385 c
14 > pick 055a42cdd887 d
14 > pick 055a42cdd887 d
15 > EOF
15 > EOF
16 $ initrepo ()
16 $ initrepo ()
17 > {
17 > {
18 > hg init r
18 > hg init r
19 > cd r
19 > cd r
20 > for x in a b c d e f ; do
20 > for x in a b c d e f ; do
21 > echo $x > $x
21 > echo $x > $x
22 > hg add $x
22 > hg add $x
23 > hg ci -m $x
23 > hg ci -m $x
24 > done
24 > done
25 > }
25 > }
26
26
27 $ initrepo
27 $ initrepo
28
28
29 log before edit
29 log before edit
30 $ hg log --graph
30 $ hg log --graph
31 @ changeset: 5:652413bf663e
31 @ changeset: 5:652413bf663e
32 | tag: tip
32 | tag: tip
33 | user: test
33 | user: test
34 | date: Thu Jan 01 00:00:00 1970 +0000
34 | date: Thu Jan 01 00:00:00 1970 +0000
35 | summary: f
35 | summary: f
36 |
36 |
37 o changeset: 4:e860deea161a
37 o changeset: 4:e860deea161a
38 | user: test
38 | user: test
39 | date: Thu Jan 01 00:00:00 1970 +0000
39 | date: Thu Jan 01 00:00:00 1970 +0000
40 | summary: e
40 | summary: e
41 |
41 |
42 o changeset: 3:055a42cdd887
42 o changeset: 3:055a42cdd887
43 | user: test
43 | user: test
44 | date: Thu Jan 01 00:00:00 1970 +0000
44 | date: Thu Jan 01 00:00:00 1970 +0000
45 | summary: d
45 | summary: d
46 |
46 |
47 o changeset: 2:177f92b77385
47 o changeset: 2:177f92b77385
48 | user: test
48 | user: test
49 | date: Thu Jan 01 00:00:00 1970 +0000
49 | date: Thu Jan 01 00:00:00 1970 +0000
50 | summary: c
50 | summary: c
51 |
51 |
52 o changeset: 1:d2ae7f538514
52 o changeset: 1:d2ae7f538514
53 | user: test
53 | user: test
54 | date: Thu Jan 01 00:00:00 1970 +0000
54 | date: Thu Jan 01 00:00:00 1970 +0000
55 | summary: b
55 | summary: b
56 |
56 |
57 o changeset: 0:cb9a9f314b8b
57 o changeset: 0:cb9a9f314b8b
58 user: test
58 user: test
59 date: Thu Jan 01 00:00:00 1970 +0000
59 date: Thu Jan 01 00:00:00 1970 +0000
60 summary: a
60 summary: a
61
61
62
62
63 edit the history
63 edit the history
64 $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
64 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
65 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
65 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
66 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
66 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
67 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
67 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
68 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
69 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
71
71
72 log after edit
72 log after edit
73 $ hg log --graph
73 $ hg log --graph
74 @ changeset: 4:82b0c1ff1777
74 @ changeset: 4:82b0c1ff1777
75 | tag: tip
75 | tag: tip
76 | user: test
76 | user: test
77 | date: Thu Jan 01 00:00:00 1970 +0000
77 | date: Thu Jan 01 00:00:00 1970 +0000
78 | summary: d
78 | summary: d
79 |
79 |
80 o changeset: 3:150aafb44a91
80 o changeset: 3:150aafb44a91
81 | user: test
81 | user: test
82 | date: Thu Jan 01 00:00:00 1970 +0000
82 | date: Thu Jan 01 00:00:00 1970 +0000
83 | summary: pick e860deea161a e
83 | summary: pick e860deea161a e
84 |
84 |
85 o changeset: 2:493dc0964412
85 o changeset: 2:493dc0964412
86 | user: test
86 | user: test
87 | date: Thu Jan 01 00:00:00 1970 +0000
87 | date: Thu Jan 01 00:00:00 1970 +0000
88 | summary: e
88 | summary: e
89 |
89 |
90 o changeset: 1:d2ae7f538514
90 o changeset: 1:d2ae7f538514
91 | user: test
91 | user: test
92 | date: Thu Jan 01 00:00:00 1970 +0000
92 | date: Thu Jan 01 00:00:00 1970 +0000
93 | summary: b
93 | summary: b
94 |
94 |
95 o changeset: 0:cb9a9f314b8b
95 o changeset: 0:cb9a9f314b8b
96 user: test
96 user: test
97 date: Thu Jan 01 00:00:00 1970 +0000
97 date: Thu Jan 01 00:00:00 1970 +0000
98 summary: a
98 summary: a
99
99
100
100
101 post-fold manifest
101 post-fold manifest
102 $ hg manifest
102 $ hg manifest
103 a
103 a
104 b
104 b
105 c
105 c
106 d
106 d
107 e
107 e
108 f
108 f
109
109
110 $ cd ..
110 $ cd ..
@@ -1,189 +1,187 b''
1 test for old histedit issue #6:
1 test for old histedit issue #6:
2 editing a changeset without any actual change would corrupt the repository
2 editing a changeset without any actual change would corrupt the repository
3
3
4 $ . "$TESTDIR/histedit-helpers.sh"
4 $ . "$TESTDIR/histedit-helpers.sh"
5
5
6 $ cat >> $HGRCPATH <<EOF
6 $ cat >> $HGRCPATH <<EOF
7 > [extensions]
7 > [extensions]
8 > graphlog=
8 > graphlog=
9 > histedit=
9 > histedit=
10 > EOF
10 > EOF
11
11
12 $ initrepo ()
12 $ initrepo ()
13 > {
13 > {
14 > dir="$1"
14 > dir="$1"
15 > comment="$2"
15 > comment="$2"
16 > if [ -n "${comment}" ]; then
16 > if [ -n "${comment}" ]; then
17 > echo % ${comment}
17 > echo % ${comment}
18 > echo % ${comment} | sed 's:.:-:g'
18 > echo % ${comment} | sed 's:.:-:g'
19 > fi
19 > fi
20 > hg init ${dir}
20 > hg init ${dir}
21 > cd ${dir}
21 > cd ${dir}
22 > for x in a b c d e f ; do
22 > for x in a b c d e f ; do
23 > echo $x > $x
23 > echo $x > $x
24 > hg add $x
24 > hg add $x
25 > hg ci -m $x
25 > hg ci -m $x
26 > done
26 > done
27 > cd ..
27 > cd ..
28 > }
28 > }
29
29
30 $ geneditor ()
30 $ geneditor ()
31 > {
31 > {
32 > # generate an editor script for selecting changesets to be edited
32 > # generate an editor script for selecting changesets to be edited
33 > choice=$1 # changesets that should be edited (using sed line ranges)
33 > choice=$1 # changesets that should be edited (using sed line ranges)
34 > cat <<EOF | sed 's:^....::'
34 > cat <<EOF | sed 's:^....::'
35 > #!/bin/sh
36 > # editing the rules, replacing 'pick' with 'edit' for the chosen lines
35 > # editing the rules, replacing 'pick' with 'edit' for the chosen lines
37 > sed '${choice}s:^pick:edit:' \$1 > \${1}.tmp
36 > sed '${choice}s:^pick:edit:' "\$1" > "\${1}.tmp"
38 > mv \${1}.tmp \$1
37 > mv "\${1}.tmp" "\$1"
39 > # displaying the resulting rules, minus comments and empty lines
38 > # displaying the resulting rules, minus comments and empty lines
40 > sed '/^#/d;/^$/d;s:^:| :' \$1 >&2
39 > sed '/^#/d;/^$/d;s:^:| :' "\$1" >&2
41 > EOF
40 > EOF
42 > }
41 > }
43
42
44 $ startediting ()
43 $ startediting ()
45 > {
44 > {
46 > # begin an editing session
45 > # begin an editing session
47 > choice="$1" # changesets that should be edited
46 > choice="$1" # changesets that should be edited
48 > number="$2" # number of changesets considered (from tip)
47 > number="$2" # number of changesets considered (from tip)
49 > comment="$3"
48 > comment="$3"
50 > geneditor "${choice}" > edit.sh
49 > geneditor "${choice}" > edit.sh
51 > chmod +x edit.sh
52 > echo % start editing the history ${comment}
50 > echo % start editing the history ${comment}
53 > HGEDITOR=./edit.sh hg histedit -- -${number} 2>&1 | fixbundle
51 > HGEDITOR="sh ./edit.sh" hg histedit -- -${number} 2>&1 | fixbundle
54 > }
52 > }
55
53
56 $ continueediting ()
54 $ continueediting ()
57 > {
55 > {
58 > # continue an edit already in progress
56 > # continue an edit already in progress
59 > editor="$1" # message editor when finalizing editing
57 > editor="$1" # message editor when finalizing editing
60 > comment="$2"
58 > comment="$2"
61 > echo % finalize changeset editing ${comment}
59 > echo % finalize changeset editing ${comment}
62 > HGEDITOR=${editor} hg histedit --continue 2>&1 | fixbundle
60 > HGEDITOR=${editor} hg histedit --continue 2>&1 | fixbundle
63 > }
61 > }
64
62
65 $ graphlog ()
63 $ graphlog ()
66 > {
64 > {
67 > comment="${1:-log}"
65 > comment="${1:-log}"
68 > echo % "${comment}"
66 > echo % "${comment}"
69 > hg glog --template '{rev} {node} \"{desc|firstline}\"\n'
67 > hg glog --template '{rev} {node} \"{desc|firstline}\"\n'
70 > }
68 > }
71
69
72
70
73 $ initrepo r1 "test editing with no change"
71 $ initrepo r1 "test editing with no change"
74 % test editing with no change
72 % test editing with no change
75 -----------------------------
73 -----------------------------
76 $ cd r1
74 $ cd r1
77 $ graphlog "log before editing"
75 $ graphlog "log before editing"
78 % log before editing
76 % log before editing
79 @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
77 @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
80 |
78 |
81 o 4 e860deea161a2f77de56603b340ebbb4536308ae "e"
79 o 4 e860deea161a2f77de56603b340ebbb4536308ae "e"
82 |
80 |
83 o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
81 o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
84 |
82 |
85 o 2 177f92b773850b59254aa5e923436f921b55483b "c"
83 o 2 177f92b773850b59254aa5e923436f921b55483b "c"
86 |
84 |
87 o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
85 o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
88 |
86 |
89 o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
87 o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
90
88
91 $ startediting 2 3 "(not changing anything)" # edit the 2nd of 3 changesets
89 $ startediting 2 3 "(not changing anything)" # edit the 2nd of 3 changesets
92 % start editing the history (not changing anything)
90 % start editing the history (not changing anything)
93 | pick 055a42cdd887 3 d
91 | pick 055a42cdd887 3 d
94 | edit e860deea161a 4 e
92 | edit e860deea161a 4 e
95 | pick 652413bf663e 5 f
93 | pick 652413bf663e 5 f
96 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
94 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
97 abort: Make changes as needed, you may commit or record as needed now.
95 abort: Make changes as needed, you may commit or record as needed now.
98 When you are finished, run hg histedit --continue to resume.
96 When you are finished, run hg histedit --continue to resume.
99 $ continueediting true "(leaving commit message unaltered)"
97 $ continueediting true "(leaving commit message unaltered)"
100 % finalize changeset editing (leaving commit message unaltered)
98 % finalize changeset editing (leaving commit message unaltered)
101 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
99 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
102
100
103 check state of working copy
101 check state of working copy
104 $ hg id
102 $ hg id
105 652413bf663e tip
103 652413bf663e tip
106
104
107 $ graphlog "log after history editing"
105 $ graphlog "log after history editing"
108 % log after history editing
106 % log after history editing
109 @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
107 @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
110 |
108 |
111 o 4 e860deea161a2f77de56603b340ebbb4536308ae "e"
109 o 4 e860deea161a2f77de56603b340ebbb4536308ae "e"
112 |
110 |
113 o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
111 o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
114 |
112 |
115 o 2 177f92b773850b59254aa5e923436f921b55483b "c"
113 o 2 177f92b773850b59254aa5e923436f921b55483b "c"
116 |
114 |
117 o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
115 o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
118 |
116 |
119 o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
117 o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
120
118
121
119
122 $ cd ..
120 $ cd ..
123
121
124 $ initrepo r2 "test editing with no change, then abort"
122 $ initrepo r2 "test editing with no change, then abort"
125 % test editing with no change, then abort
123 % test editing with no change, then abort
126 -----------------------------------------
124 -----------------------------------------
127 $ cd r2
125 $ cd r2
128 $ graphlog "log before editing"
126 $ graphlog "log before editing"
129 % log before editing
127 % log before editing
130 @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
128 @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
131 |
129 |
132 o 4 e860deea161a2f77de56603b340ebbb4536308ae "e"
130 o 4 e860deea161a2f77de56603b340ebbb4536308ae "e"
133 |
131 |
134 o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
132 o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
135 |
133 |
136 o 2 177f92b773850b59254aa5e923436f921b55483b "c"
134 o 2 177f92b773850b59254aa5e923436f921b55483b "c"
137 |
135 |
138 o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
136 o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
139 |
137 |
140 o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
138 o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
141
139
142 $ startediting 1,2 3 "(not changing anything)" # edit the 1st two of 3 changesets
140 $ startediting 1,2 3 "(not changing anything)" # edit the 1st two of 3 changesets
143 % start editing the history (not changing anything)
141 % start editing the history (not changing anything)
144 | edit 055a42cdd887 3 d
142 | edit 055a42cdd887 3 d
145 | edit e860deea161a 4 e
143 | edit e860deea161a 4 e
146 | pick 652413bf663e 5 f
144 | pick 652413bf663e 5 f
147 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
145 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
148 abort: Make changes as needed, you may commit or record as needed now.
146 abort: Make changes as needed, you may commit or record as needed now.
149 When you are finished, run hg histedit --continue to resume.
147 When you are finished, run hg histedit --continue to resume.
150 $ continueediting true "(leaving commit message unaltered)"
148 $ continueediting true "(leaving commit message unaltered)"
151 % finalize changeset editing (leaving commit message unaltered)
149 % finalize changeset editing (leaving commit message unaltered)
152 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
150 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 abort: Make changes as needed, you may commit or record as needed now.
151 abort: Make changes as needed, you may commit or record as needed now.
154 When you are finished, run hg histedit --continue to resume.
152 When you are finished, run hg histedit --continue to resume.
155 $ graphlog "log after first edit"
153 $ graphlog "log after first edit"
156 % log after first edit
154 % log after first edit
157 o 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
155 o 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
158 |
156 |
159 o 4 e860deea161a2f77de56603b340ebbb4536308ae "e"
157 o 4 e860deea161a2f77de56603b340ebbb4536308ae "e"
160 |
158 |
161 @ 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
159 @ 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
162 |
160 |
163 o 2 177f92b773850b59254aa5e923436f921b55483b "c"
161 o 2 177f92b773850b59254aa5e923436f921b55483b "c"
164 |
162 |
165 o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
163 o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
166 |
164 |
167 o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
165 o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
168
166
169
167
170 abort editing session
168 abort editing session
171 $ hg histedit --abort 2>&1 | fixbundle
169 $ hg histedit --abort 2>&1 | fixbundle
172 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
173
171
174 $ graphlog "log after abort"
172 $ graphlog "log after abort"
175 % log after abort
173 % log after abort
176 @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
174 @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
177 |
175 |
178 o 4 e860deea161a2f77de56603b340ebbb4536308ae "e"
176 o 4 e860deea161a2f77de56603b340ebbb4536308ae "e"
179 |
177 |
180 o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
178 o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
181 |
179 |
182 o 2 177f92b773850b59254aa5e923436f921b55483b "c"
180 o 2 177f92b773850b59254aa5e923436f921b55483b "c"
183 |
181 |
184 o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
182 o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
185 |
183 |
186 o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
184 o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
187
185
188
186
189 $ cd ..
187 $ cd ..
@@ -1,131 +1,131 b''
1 $ . "$TESTDIR/histedit-helpers.sh"
1 $ . "$TESTDIR/histedit-helpers.sh"
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > graphlog=
5 > graphlog=
6 > histedit=
6 > histedit=
7 > EOF
7 > EOF
8
8
9 $ EDITED=`pwd`/editedhistory
9 $ EDITED=`pwd`/editedhistory
10 $ cat > $EDITED <<EOF
10 $ cat > $EDITED <<EOF
11 > pick 177f92b77385 c
11 > pick 177f92b77385 c
12 > pick 055a42cdd887 d
12 > pick 055a42cdd887 d
13 > pick bfa474341cc9 does not commute with e
13 > pick bfa474341cc9 does not commute with e
14 > pick e860deea161a e
14 > pick e860deea161a e
15 > pick 652413bf663e f
15 > pick 652413bf663e f
16 > EOF
16 > EOF
17 $ initrepo ()
17 $ initrepo ()
18 > {
18 > {
19 > hg init r
19 > hg init r
20 > cd r
20 > cd r
21 > for x in a b c d e f ; do
21 > for x in a b c d e f ; do
22 > echo $x > $x
22 > echo $x > $x
23 > hg add $x
23 > hg add $x
24 > hg ci -m $x
24 > hg ci -m $x
25 > done
25 > done
26 > echo a >> e
26 > echo a >> e
27 > hg ci -m 'does not commute with e'
27 > hg ci -m 'does not commute with e'
28 > cd ..
28 > cd ..
29 > }
29 > }
30
30
31 $ initrepo
31 $ initrepo
32 $ cd r
32 $ cd r
33
33
34 log before edit
34 log before edit
35 $ hg log --graph
35 $ hg log --graph
36 @ changeset: 6:bfa474341cc9
36 @ changeset: 6:bfa474341cc9
37 | tag: tip
37 | tag: tip
38 | user: test
38 | user: test
39 | date: Thu Jan 01 00:00:00 1970 +0000
39 | date: Thu Jan 01 00:00:00 1970 +0000
40 | summary: does not commute with e
40 | summary: does not commute with e
41 |
41 |
42 o changeset: 5:652413bf663e
42 o changeset: 5:652413bf663e
43 | user: test
43 | user: test
44 | date: Thu Jan 01 00:00:00 1970 +0000
44 | date: Thu Jan 01 00:00:00 1970 +0000
45 | summary: f
45 | summary: f
46 |
46 |
47 o changeset: 4:e860deea161a
47 o changeset: 4:e860deea161a
48 | user: test
48 | user: test
49 | date: Thu Jan 01 00:00:00 1970 +0000
49 | date: Thu Jan 01 00:00:00 1970 +0000
50 | summary: e
50 | summary: e
51 |
51 |
52 o changeset: 3:055a42cdd887
52 o changeset: 3:055a42cdd887
53 | user: test
53 | user: test
54 | date: Thu Jan 01 00:00:00 1970 +0000
54 | date: Thu Jan 01 00:00:00 1970 +0000
55 | summary: d
55 | summary: d
56 |
56 |
57 o changeset: 2:177f92b77385
57 o changeset: 2:177f92b77385
58 | user: test
58 | user: test
59 | date: Thu Jan 01 00:00:00 1970 +0000
59 | date: Thu Jan 01 00:00:00 1970 +0000
60 | summary: c
60 | summary: c
61 |
61 |
62 o changeset: 1:d2ae7f538514
62 o changeset: 1:d2ae7f538514
63 | user: test
63 | user: test
64 | date: Thu Jan 01 00:00:00 1970 +0000
64 | date: Thu Jan 01 00:00:00 1970 +0000
65 | summary: b
65 | summary: b
66 |
66 |
67 o changeset: 0:cb9a9f314b8b
67 o changeset: 0:cb9a9f314b8b
68 user: test
68 user: test
69 date: Thu Jan 01 00:00:00 1970 +0000
69 date: Thu Jan 01 00:00:00 1970 +0000
70 summary: a
70 summary: a
71
71
72
72
73 edit the history
73 edit the history
74 $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
74 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
75 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
75 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
76 1 out of 1 hunks FAILED -- saving rejects to file e.rej
76 1 out of 1 hunks FAILED -- saving rejects to file e.rej
77 abort: Fix up the change and run hg histedit --continue
77 abort: Fix up the change and run hg histedit --continue
78
78
79 fix up (pre abort)
79 fix up (pre abort)
80 $ echo a > e
80 $ echo a > e
81 $ hg add e
81 $ hg add e
82 $ hg histedit --continue 2>&1 | fixbundle
82 $ hg histedit --continue 2>&1 | fixbundle
83 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 file e already exists
84 file e already exists
85 1 out of 1 hunks FAILED -- saving rejects to file e.rej
85 1 out of 1 hunks FAILED -- saving rejects to file e.rej
86 abort: Fix up the change and run hg histedit --continue
86 abort: Fix up the change and run hg histedit --continue
87
87
88 abort the edit
88 abort the edit
89 $ hg histedit --abort 2>&1 | fixbundle
89 $ hg histedit --abort 2>&1 | fixbundle
90 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
91
91
92 log after abort
92 log after abort
93 $ hg log --graph
93 $ hg log --graph
94 @ changeset: 6:bfa474341cc9
94 @ changeset: 6:bfa474341cc9
95 | tag: tip
95 | tag: tip
96 | user: test
96 | user: test
97 | date: Thu Jan 01 00:00:00 1970 +0000
97 | date: Thu Jan 01 00:00:00 1970 +0000
98 | summary: does not commute with e
98 | summary: does not commute with e
99 |
99 |
100 o changeset: 5:652413bf663e
100 o changeset: 5:652413bf663e
101 | user: test
101 | user: test
102 | date: Thu Jan 01 00:00:00 1970 +0000
102 | date: Thu Jan 01 00:00:00 1970 +0000
103 | summary: f
103 | summary: f
104 |
104 |
105 o changeset: 4:e860deea161a
105 o changeset: 4:e860deea161a
106 | user: test
106 | user: test
107 | date: Thu Jan 01 00:00:00 1970 +0000
107 | date: Thu Jan 01 00:00:00 1970 +0000
108 | summary: e
108 | summary: e
109 |
109 |
110 o changeset: 3:055a42cdd887
110 o changeset: 3:055a42cdd887
111 | user: test
111 | user: test
112 | date: Thu Jan 01 00:00:00 1970 +0000
112 | date: Thu Jan 01 00:00:00 1970 +0000
113 | summary: d
113 | summary: d
114 |
114 |
115 o changeset: 2:177f92b77385
115 o changeset: 2:177f92b77385
116 | user: test
116 | user: test
117 | date: Thu Jan 01 00:00:00 1970 +0000
117 | date: Thu Jan 01 00:00:00 1970 +0000
118 | summary: c
118 | summary: c
119 |
119 |
120 o changeset: 1:d2ae7f538514
120 o changeset: 1:d2ae7f538514
121 | user: test
121 | user: test
122 | date: Thu Jan 01 00:00:00 1970 +0000
122 | date: Thu Jan 01 00:00:00 1970 +0000
123 | summary: b
123 | summary: b
124 |
124 |
125 o changeset: 0:cb9a9f314b8b
125 o changeset: 0:cb9a9f314b8b
126 user: test
126 user: test
127 date: Thu Jan 01 00:00:00 1970 +0000
127 date: Thu Jan 01 00:00:00 1970 +0000
128 summary: a
128 summary: a
129
129
130
130
131 $ cd ..
131 $ cd ..
@@ -1,244 +1,244 b''
1 $ . "$TESTDIR/histedit-helpers.sh"
1 $ . "$TESTDIR/histedit-helpers.sh"
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > graphlog=
5 > graphlog=
6 > histedit=
6 > histedit=
7 > EOF
7 > EOF
8
8
9 $ EDITED=`pwd`/editedhistory
9 $ EDITED=`pwd`/editedhistory
10 $ cat > $EDITED <<EOF
10 $ cat > $EDITED <<EOF
11 > pick 177f92b77385 c
11 > pick 177f92b77385 c
12 > pick 055a42cdd887 d
12 > pick 055a42cdd887 d
13 > pick bfa474341cc9 does not commute with e
13 > pick bfa474341cc9 does not commute with e
14 > pick e860deea161a e
14 > pick e860deea161a e
15 > pick 652413bf663e f
15 > pick 652413bf663e f
16 > EOF
16 > EOF
17 $ initrepo ()
17 $ initrepo ()
18 > {
18 > {
19 > hg init $1
19 > hg init $1
20 > cd $1
20 > cd $1
21 > for x in a b c d e f ; do
21 > for x in a b c d e f ; do
22 > echo $x > $x
22 > echo $x > $x
23 > hg add $x
23 > hg add $x
24 > hg ci -m $x
24 > hg ci -m $x
25 > done
25 > done
26 > echo a >> e
26 > echo a >> e
27 > hg ci -m 'does not commute with e'
27 > hg ci -m 'does not commute with e'
28 > cd ..
28 > cd ..
29 > }
29 > }
30
30
31 $ initrepo r1
31 $ initrepo r1
32 $ cd r1
32 $ cd r1
33
33
34 log before edit
34 log before edit
35 $ hg log --graph
35 $ hg log --graph
36 @ changeset: 6:bfa474341cc9
36 @ changeset: 6:bfa474341cc9
37 | tag: tip
37 | tag: tip
38 | user: test
38 | user: test
39 | date: Thu Jan 01 00:00:00 1970 +0000
39 | date: Thu Jan 01 00:00:00 1970 +0000
40 | summary: does not commute with e
40 | summary: does not commute with e
41 |
41 |
42 o changeset: 5:652413bf663e
42 o changeset: 5:652413bf663e
43 | user: test
43 | user: test
44 | date: Thu Jan 01 00:00:00 1970 +0000
44 | date: Thu Jan 01 00:00:00 1970 +0000
45 | summary: f
45 | summary: f
46 |
46 |
47 o changeset: 4:e860deea161a
47 o changeset: 4:e860deea161a
48 | user: test
48 | user: test
49 | date: Thu Jan 01 00:00:00 1970 +0000
49 | date: Thu Jan 01 00:00:00 1970 +0000
50 | summary: e
50 | summary: e
51 |
51 |
52 o changeset: 3:055a42cdd887
52 o changeset: 3:055a42cdd887
53 | user: test
53 | user: test
54 | date: Thu Jan 01 00:00:00 1970 +0000
54 | date: Thu Jan 01 00:00:00 1970 +0000
55 | summary: d
55 | summary: d
56 |
56 |
57 o changeset: 2:177f92b77385
57 o changeset: 2:177f92b77385
58 | user: test
58 | user: test
59 | date: Thu Jan 01 00:00:00 1970 +0000
59 | date: Thu Jan 01 00:00:00 1970 +0000
60 | summary: c
60 | summary: c
61 |
61 |
62 o changeset: 1:d2ae7f538514
62 o changeset: 1:d2ae7f538514
63 | user: test
63 | user: test
64 | date: Thu Jan 01 00:00:00 1970 +0000
64 | date: Thu Jan 01 00:00:00 1970 +0000
65 | summary: b
65 | summary: b
66 |
66 |
67 o changeset: 0:cb9a9f314b8b
67 o changeset: 0:cb9a9f314b8b
68 user: test
68 user: test
69 date: Thu Jan 01 00:00:00 1970 +0000
69 date: Thu Jan 01 00:00:00 1970 +0000
70 summary: a
70 summary: a
71
71
72
72
73 edit the history
73 edit the history
74 $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
74 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
75 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
75 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
76 1 out of 1 hunks FAILED -- saving rejects to file e.rej
76 1 out of 1 hunks FAILED -- saving rejects to file e.rej
77 abort: Fix up the change and run hg histedit --continue
77 abort: Fix up the change and run hg histedit --continue
78
78
79 abort the edit
79 abort the edit
80 $ hg histedit --abort 2>&1 | fixbundle
80 $ hg histedit --abort 2>&1 | fixbundle
81 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
82
82
83
83
84 second edit set
84 second edit set
85
85
86 $ hg log --graph
86 $ hg log --graph
87 @ changeset: 6:bfa474341cc9
87 @ changeset: 6:bfa474341cc9
88 | tag: tip
88 | tag: tip
89 | user: test
89 | user: test
90 | date: Thu Jan 01 00:00:00 1970 +0000
90 | date: Thu Jan 01 00:00:00 1970 +0000
91 | summary: does not commute with e
91 | summary: does not commute with e
92 |
92 |
93 o changeset: 5:652413bf663e
93 o changeset: 5:652413bf663e
94 | user: test
94 | user: test
95 | date: Thu Jan 01 00:00:00 1970 +0000
95 | date: Thu Jan 01 00:00:00 1970 +0000
96 | summary: f
96 | summary: f
97 |
97 |
98 o changeset: 4:e860deea161a
98 o changeset: 4:e860deea161a
99 | user: test
99 | user: test
100 | date: Thu Jan 01 00:00:00 1970 +0000
100 | date: Thu Jan 01 00:00:00 1970 +0000
101 | summary: e
101 | summary: e
102 |
102 |
103 o changeset: 3:055a42cdd887
103 o changeset: 3:055a42cdd887
104 | user: test
104 | user: test
105 | date: Thu Jan 01 00:00:00 1970 +0000
105 | date: Thu Jan 01 00:00:00 1970 +0000
106 | summary: d
106 | summary: d
107 |
107 |
108 o changeset: 2:177f92b77385
108 o changeset: 2:177f92b77385
109 | user: test
109 | user: test
110 | date: Thu Jan 01 00:00:00 1970 +0000
110 | date: Thu Jan 01 00:00:00 1970 +0000
111 | summary: c
111 | summary: c
112 |
112 |
113 o changeset: 1:d2ae7f538514
113 o changeset: 1:d2ae7f538514
114 | user: test
114 | user: test
115 | date: Thu Jan 01 00:00:00 1970 +0000
115 | date: Thu Jan 01 00:00:00 1970 +0000
116 | summary: b
116 | summary: b
117 |
117 |
118 o changeset: 0:cb9a9f314b8b
118 o changeset: 0:cb9a9f314b8b
119 user: test
119 user: test
120 date: Thu Jan 01 00:00:00 1970 +0000
120 date: Thu Jan 01 00:00:00 1970 +0000
121 summary: a
121 summary: a
122
122
123
123
124 edit the history
124 edit the history
125 $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
125 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
126 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
126 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
127 1 out of 1 hunks FAILED -- saving rejects to file e.rej
127 1 out of 1 hunks FAILED -- saving rejects to file e.rej
128 abort: Fix up the change and run hg histedit --continue
128 abort: Fix up the change and run hg histedit --continue
129
129
130 fix up
130 fix up
131 $ echo a > e
131 $ echo a > e
132 $ hg add e
132 $ hg add e
133 $ hg histedit --continue 2>&1 | fixbundle
133 $ hg histedit --continue 2>&1 | fixbundle
134 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
134 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
135 file e already exists
135 file e already exists
136 1 out of 1 hunks FAILED -- saving rejects to file e.rej
136 1 out of 1 hunks FAILED -- saving rejects to file e.rej
137 abort: Fix up the change and run hg histedit --continue
137 abort: Fix up the change and run hg histedit --continue
138
138
139 just continue this time
139 just continue this time
140 $ hg histedit --continue 2>&1 | fixbundle
140 $ hg histedit --continue 2>&1 | fixbundle
141 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
142 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
142 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
143
143
144 log after edit
144 log after edit
145 $ hg log --graph
145 $ hg log --graph
146 @ changeset: 5:9ab84894b459
146 @ changeset: 5:9ab84894b459
147 | tag: tip
147 | tag: tip
148 | user: test
148 | user: test
149 | date: Thu Jan 01 00:00:00 1970 +0000
149 | date: Thu Jan 01 00:00:00 1970 +0000
150 | summary: f
150 | summary: f
151 |
151 |
152 o changeset: 4:1fff3ae8199d
152 o changeset: 4:1fff3ae8199d
153 | user: test
153 | user: test
154 | date: Thu Jan 01 00:00:00 1970 +0000
154 | date: Thu Jan 01 00:00:00 1970 +0000
155 | summary: does not commute with e
155 | summary: does not commute with e
156 |
156 |
157 o changeset: 3:055a42cdd887
157 o changeset: 3:055a42cdd887
158 | user: test
158 | user: test
159 | date: Thu Jan 01 00:00:00 1970 +0000
159 | date: Thu Jan 01 00:00:00 1970 +0000
160 | summary: d
160 | summary: d
161 |
161 |
162 o changeset: 2:177f92b77385
162 o changeset: 2:177f92b77385
163 | user: test
163 | user: test
164 | date: Thu Jan 01 00:00:00 1970 +0000
164 | date: Thu Jan 01 00:00:00 1970 +0000
165 | summary: c
165 | summary: c
166 |
166 |
167 o changeset: 1:d2ae7f538514
167 o changeset: 1:d2ae7f538514
168 | user: test
168 | user: test
169 | date: Thu Jan 01 00:00:00 1970 +0000
169 | date: Thu Jan 01 00:00:00 1970 +0000
170 | summary: b
170 | summary: b
171 |
171 |
172 o changeset: 0:cb9a9f314b8b
172 o changeset: 0:cb9a9f314b8b
173 user: test
173 user: test
174 date: Thu Jan 01 00:00:00 1970 +0000
174 date: Thu Jan 01 00:00:00 1970 +0000
175 summary: a
175 summary: a
176
176
177
177
178 start over
178 start over
179
179
180 $ cd ..
180 $ cd ..
181
181
182 $ initrepo r2
182 $ initrepo r2
183 $ cd r2
183 $ cd r2
184 $ cat > $EDITED <<EOF
184 $ cat > $EDITED <<EOF
185 > pick 177f92b77385 c
185 > pick 177f92b77385 c
186 > pick 055a42cdd887 d
186 > pick 055a42cdd887 d
187 > mess bfa474341cc9 does not commute with e
187 > mess bfa474341cc9 does not commute with e
188 > pick e860deea161a e
188 > pick e860deea161a e
189 > pick 652413bf663e f
189 > pick 652413bf663e f
190 > EOF
190 > EOF
191
191
192 edit the history, this time with a fold action
192 edit the history, this time with a fold action
193 $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
193 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
194 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
194 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
195 1 out of 1 hunks FAILED -- saving rejects to file e.rej
195 1 out of 1 hunks FAILED -- saving rejects to file e.rej
196 abort: Fix up the change and run hg histedit --continue
196 abort: Fix up the change and run hg histedit --continue
197
197
198 $ echo a > e
198 $ echo a > e
199 $ hg add e
199 $ hg add e
200 $ HGEDITOR="cat $EDITED > " hg histedit --continue 2>&1 | fixbundle
200 $ HGEDITOR="cat \"$EDITED\" > " hg histedit --continue 2>&1 | fixbundle
201 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
201 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
202 file e already exists
202 file e already exists
203 1 out of 1 hunks FAILED -- saving rejects to file e.rej
203 1 out of 1 hunks FAILED -- saving rejects to file e.rej
204 abort: Fix up the change and run hg histedit --continue
204 abort: Fix up the change and run hg histedit --continue
205 second edit also fails, but just continue
205 second edit also fails, but just continue
206 $ hg histedit --continue 2>&1 | fixbundle
206 $ hg histedit --continue 2>&1 | fixbundle
207 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
207 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
208 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
208 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
209
209
210 post message fix
210 post message fix
211 $ hg log --graph
211 $ hg log --graph
212 @ changeset: 5:6459970fb49b
212 @ changeset: 5:6459970fb49b
213 | tag: tip
213 | tag: tip
214 | user: test
214 | user: test
215 | date: Thu Jan 01 00:00:00 1970 +0000
215 | date: Thu Jan 01 00:00:00 1970 +0000
216 | summary: f
216 | summary: f
217 |
217 |
218 o changeset: 4:556f27c874b0
218 o changeset: 4:556f27c874b0
219 | user: test
219 | user: test
220 | date: Thu Jan 01 00:00:00 1970 +0000
220 | date: Thu Jan 01 00:00:00 1970 +0000
221 | summary: pick 177f92b77385 c
221 | summary: pick 177f92b77385 c
222 |
222 |
223 o changeset: 3:055a42cdd887
223 o changeset: 3:055a42cdd887
224 | user: test
224 | user: test
225 | date: Thu Jan 01 00:00:00 1970 +0000
225 | date: Thu Jan 01 00:00:00 1970 +0000
226 | summary: d
226 | summary: d
227 |
227 |
228 o changeset: 2:177f92b77385
228 o changeset: 2:177f92b77385
229 | user: test
229 | user: test
230 | date: Thu Jan 01 00:00:00 1970 +0000
230 | date: Thu Jan 01 00:00:00 1970 +0000
231 | summary: c
231 | summary: c
232 |
232 |
233 o changeset: 1:d2ae7f538514
233 o changeset: 1:d2ae7f538514
234 | user: test
234 | user: test
235 | date: Thu Jan 01 00:00:00 1970 +0000
235 | date: Thu Jan 01 00:00:00 1970 +0000
236 | summary: b
236 | summary: b
237 |
237 |
238 o changeset: 0:cb9a9f314b8b
238 o changeset: 0:cb9a9f314b8b
239 user: test
239 user: test
240 date: Thu Jan 01 00:00:00 1970 +0000
240 date: Thu Jan 01 00:00:00 1970 +0000
241 summary: a
241 summary: a
242
242
243
243
244 $ cd ..
244 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now