##// END OF EJS Templates
tests: choose the proper environment variable style for the platform...
Matt Harbison -
r23390:6a3e38a1 default
parent child Browse files
Show More
@@ -1,490 +1,497 b''
1 Test histedit extension: Fold commands
1 Test histedit extension: Fold commands
2 ======================================
2 ======================================
3
3
4 This test file is dedicated to testing the fold command in non conflicting
4 This test file is dedicated to testing the fold command in non conflicting
5 case.
5 case.
6
6
7 Initialization
7 Initialization
8 ---------------
8 ---------------
9
9
10
10
11 $ . "$TESTDIR/histedit-helpers.sh"
11 $ . "$TESTDIR/histedit-helpers.sh"
12
12
13 $ cat >> $HGRCPATH <<EOF
13 $ cat >> $HGRCPATH <<EOF
14 > [alias]
14 > [alias]
15 > logt = log --template '{rev}:{node|short} {desc|firstline}\n'
15 > logt = log --template '{rev}:{node|short} {desc|firstline}\n'
16 > [extensions]
16 > [extensions]
17 > histedit=
17 > histedit=
18 > EOF
18 > EOF
19
19
20
20
21 Simple folding
21 Simple folding
22 --------------------
22 --------------------
23 $ initrepo ()
23 $ initrepo ()
24 > {
24 > {
25 > hg init r
25 > hg init r
26 > cd r
26 > cd r
27 > for x in a b c d e f ; do
27 > for x in a b c d e f ; do
28 > echo $x > $x
28 > echo $x > $x
29 > hg add $x
29 > hg add $x
30 > hg ci -m $x
30 > hg ci -m $x
31 > done
31 > done
32 > }
32 > }
33
33
34 $ initrepo
34 $ initrepo
35
35
36 log before edit
36 log before edit
37 $ hg logt --graph
37 $ hg logt --graph
38 @ 5:652413bf663e f
38 @ 5:652413bf663e f
39 |
39 |
40 o 4:e860deea161a e
40 o 4:e860deea161a e
41 |
41 |
42 o 3:055a42cdd887 d
42 o 3:055a42cdd887 d
43 |
43 |
44 o 2:177f92b77385 c
44 o 2:177f92b77385 c
45 |
45 |
46 o 1:d2ae7f538514 b
46 o 1:d2ae7f538514 b
47 |
47 |
48 o 0:cb9a9f314b8b a
48 o 0:cb9a9f314b8b a
49
49
50
50
51 $ hg histedit 177f92b77385 --commands - 2>&1 <<EOF | fixbundle
51 $ hg histedit 177f92b77385 --commands - 2>&1 <<EOF | fixbundle
52 > pick e860deea161a e
52 > pick e860deea161a e
53 > pick 652413bf663e f
53 > pick 652413bf663e f
54 > fold 177f92b77385 c
54 > fold 177f92b77385 c
55 > pick 055a42cdd887 d
55 > pick 055a42cdd887 d
56 > EOF
56 > EOF
57 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
57 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
58 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
59 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
59 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
60 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
60 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
61 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
64
64
65 log after edit
65 log after edit
66 $ hg logt --graph
66 $ hg logt --graph
67 @ 4:9c277da72c9b d
67 @ 4:9c277da72c9b d
68 |
68 |
69 o 3:6de59d13424a f
69 o 3:6de59d13424a f
70 |
70 |
71 o 2:ee283cb5f2d5 e
71 o 2:ee283cb5f2d5 e
72 |
72 |
73 o 1:d2ae7f538514 b
73 o 1:d2ae7f538514 b
74 |
74 |
75 o 0:cb9a9f314b8b a
75 o 0:cb9a9f314b8b a
76
76
77
77
78 post-fold manifest
78 post-fold manifest
79 $ hg manifest
79 $ hg manifest
80 a
80 a
81 b
81 b
82 c
82 c
83 d
83 d
84 e
84 e
85 f
85 f
86
86
87
87
88 check histedit_source
88 check histedit_source
89
89
90 $ hg log --debug --rev 3
90 $ hg log --debug --rev 3
91 changeset: 3:6de59d13424a8a13acd3e975514aed29dd0d9b2d
91 changeset: 3:6de59d13424a8a13acd3e975514aed29dd0d9b2d
92 phase: draft
92 phase: draft
93 parent: 2:ee283cb5f2d5955443f23a27b697a04339e9a39a
93 parent: 2:ee283cb5f2d5955443f23a27b697a04339e9a39a
94 parent: -1:0000000000000000000000000000000000000000
94 parent: -1:0000000000000000000000000000000000000000
95 manifest: 3:81eede616954057198ead0b2c73b41d1f392829a
95 manifest: 3:81eede616954057198ead0b2c73b41d1f392829a
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 files+: c f
98 files+: c f
99 extra: branch=default
99 extra: branch=default
100 extra: histedit_source=a4f7421b80f79fcc59fff01bcbf4a53d127dd6d3,177f92b773850b59254aa5e923436f921b55483b
100 extra: histedit_source=a4f7421b80f79fcc59fff01bcbf4a53d127dd6d3,177f92b773850b59254aa5e923436f921b55483b
101 description:
101 description:
102 f
102 f
103 ***
103 ***
104 c
104 c
105
105
106
106
107
107
108 rollup will fold without preserving the folded commit's message
108 rollup will fold without preserving the folded commit's message
109
109
110 $ hg histedit d2ae7f538514 --commands - 2>&1 <<EOF | fixbundle
110 $ hg histedit d2ae7f538514 --commands - 2>&1 <<EOF | fixbundle
111 > pick d2ae7f538514 b
111 > pick d2ae7f538514 b
112 > roll ee283cb5f2d5 e
112 > roll ee283cb5f2d5 e
113 > pick 6de59d13424a f
113 > pick 6de59d13424a f
114 > pick 9c277da72c9b d
114 > pick 9c277da72c9b d
115 > EOF
115 > EOF
116 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
116 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
117 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
117 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
118 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
118 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
119 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
119 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
120 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
120 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
121 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
121 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
122
122
123 log after edit
123 log after edit
124 $ hg logt --graph
124 $ hg logt --graph
125 @ 3:c4a9eb7989fc d
125 @ 3:c4a9eb7989fc d
126 |
126 |
127 o 2:8e03a72b6f83 f
127 o 2:8e03a72b6f83 f
128 |
128 |
129 o 1:391ee782c689 b
129 o 1:391ee782c689 b
130 |
130 |
131 o 0:cb9a9f314b8b a
131 o 0:cb9a9f314b8b a
132
132
133
133
134 description is taken from rollup target commit
134 description is taken from rollup target commit
135
135
136 $ hg log --debug --rev 1
136 $ hg log --debug --rev 1
137 changeset: 1:391ee782c68930be438ccf4c6a403daedbfbffa5
137 changeset: 1:391ee782c68930be438ccf4c6a403daedbfbffa5
138 phase: draft
138 phase: draft
139 parent: 0:cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
139 parent: 0:cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
140 parent: -1:0000000000000000000000000000000000000000
140 parent: -1:0000000000000000000000000000000000000000
141 manifest: 1:b5e112a3a8354e269b1524729f0918662d847c38
141 manifest: 1:b5e112a3a8354e269b1524729f0918662d847c38
142 user: test
142 user: test
143 date: Thu Jan 01 00:00:00 1970 +0000
143 date: Thu Jan 01 00:00:00 1970 +0000
144 files+: b e
144 files+: b e
145 extra: branch=default
145 extra: branch=default
146 extra: histedit_source=d2ae7f538514cd87c17547b0de4cea71fe1af9fb,ee283cb5f2d5955443f23a27b697a04339e9a39a
146 extra: histedit_source=d2ae7f538514cd87c17547b0de4cea71fe1af9fb,ee283cb5f2d5955443f23a27b697a04339e9a39a
147 description:
147 description:
148 b
148 b
149
149
150
150
151
151
152 check saving last-message.txt
152 check saving last-message.txt
153
153
154 $ cat > $TESTTMP/abortfolding.py <<EOF
154 $ cat > $TESTTMP/abortfolding.py <<EOF
155 > from mercurial import util
155 > from mercurial import util
156 > def abortfolding(ui, repo, hooktype, **kwargs):
156 > def abortfolding(ui, repo, hooktype, **kwargs):
157 > ctx = repo[kwargs.get('node')]
157 > ctx = repo[kwargs.get('node')]
158 > if set(ctx.files()) == set(['c', 'd', 'f']):
158 > if set(ctx.files()) == set(['c', 'd', 'f']):
159 > return True # abort folding commit only
159 > return True # abort folding commit only
160 > ui.warn('allow non-folding commit\\n')
160 > ui.warn('allow non-folding commit\\n')
161 > EOF
161 > EOF
162 $ cat > .hg/hgrc <<EOF
162 $ cat > .hg/hgrc <<EOF
163 > [hooks]
163 > [hooks]
164 > pretxncommit.abortfolding = python:$TESTTMP/abortfolding.py:abortfolding
164 > pretxncommit.abortfolding = python:$TESTTMP/abortfolding.py:abortfolding
165 > EOF
165 > EOF
166
166
167 $ cat > $TESTTMP/editor.sh << EOF
167 $ cat > $TESTTMP/editor.sh << EOF
168 > echo "==== before editing"
168 > echo "==== before editing"
169 > cat \$1
169 > cat \$1
170 > echo "===="
170 > echo "===="
171 > echo "check saving last-message.txt" >> \$1
171 > echo "check saving last-message.txt" >> \$1
172 > EOF
172 > EOF
173
173
174 $ rm -f .hg/last-message.txt
174 $ rm -f .hg/last-message.txt
175 $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit 8e03a72b6f83 --commands - 2>&1 <<EOF | fixbundle
175 $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit 8e03a72b6f83 --commands - 2>&1 <<EOF | fixbundle
176 > pick 8e03a72b6f83 f
176 > pick 8e03a72b6f83 f
177 > fold c4a9eb7989fc d
177 > fold c4a9eb7989fc d
178 > EOF
178 > EOF
179 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
179 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
180 allow non-folding commit
180 allow non-folding commit
181 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
181 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
182 ==== before editing
182 ==== before editing
183 f
183 f
184 ***
184 ***
185 c
185 c
186 ***
186 ***
187 d
187 d
188
188
189
189
190
190
191 HG: Enter commit message. Lines beginning with 'HG:' are removed.
191 HG: Enter commit message. Lines beginning with 'HG:' are removed.
192 HG: Leave message empty to abort commit.
192 HG: Leave message empty to abort commit.
193 HG: --
193 HG: --
194 HG: user: test
194 HG: user: test
195 HG: branch 'default'
195 HG: branch 'default'
196 HG: changed c
196 HG: changed c
197 HG: changed d
197 HG: changed d
198 HG: changed f
198 HG: changed f
199 ====
199 ====
200 transaction abort!
200 transaction abort!
201 rollback completed
201 rollback completed
202 abort: pretxncommit.abortfolding hook failed
202 abort: pretxncommit.abortfolding hook failed
203
203
204 $ cat .hg/last-message.txt
204 $ cat .hg/last-message.txt
205 f
205 f
206 ***
206 ***
207 c
207 c
208 ***
208 ***
209 d
209 d
210
210
211
211
212
212
213 check saving last-message.txt
213 check saving last-message.txt
214
214
215 $ cd ..
215 $ cd ..
216 $ rm -r r
216 $ rm -r r
217
217
218 folding preserves initial author
218 folding preserves initial author
219 --------------------------------
219 --------------------------------
220
220
221 $ initrepo
221 $ initrepo
222
222
223 $ hg ci --user "someone else" --amend --quiet
223 $ hg ci --user "someone else" --amend --quiet
224
224
225 tip before edit
225 tip before edit
226 $ hg log --rev .
226 $ hg log --rev .
227 changeset: 5:a00ad806cb55
227 changeset: 5:a00ad806cb55
228 tag: tip
228 tag: tip
229 user: someone else
229 user: someone else
230 date: Thu Jan 01 00:00:00 1970 +0000
230 date: Thu Jan 01 00:00:00 1970 +0000
231 summary: f
231 summary: f
232
232
233
233
234 $ hg histedit e860deea161a --commands - 2>&1 <<EOF | fixbundle
234 $ hg histedit e860deea161a --commands - 2>&1 <<EOF | fixbundle
235 > pick e860deea161a e
235 > pick e860deea161a e
236 > fold a00ad806cb55 f
236 > fold a00ad806cb55 f
237 > EOF
237 > EOF
238 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
238 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
239 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
239 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
240 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
240 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
241 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
241 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
242
242
243 tip after edit
243 tip after edit
244 $ hg log --rev .
244 $ hg log --rev .
245 changeset: 4:698d4e8040a1
245 changeset: 4:698d4e8040a1
246 tag: tip
246 tag: tip
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: e
249 summary: e
250
250
251
251
252 $ cd ..
252 $ cd ..
253 $ rm -r r
253 $ rm -r r
254
254
255 folding and creating no new change doesn't break:
255 folding and creating no new change doesn't break:
256 -------------------------------------------------
256 -------------------------------------------------
257
257
258 folded content is dropped during a merge. The folded commit should properly disappear.
258 folded content is dropped during a merge. The folded commit should properly disappear.
259
259
260 $ mkdir fold-to-empty-test
260 $ mkdir fold-to-empty-test
261 $ cd fold-to-empty-test
261 $ cd fold-to-empty-test
262 $ hg init
262 $ hg init
263 $ printf "1\n2\n3\n" > file
263 $ printf "1\n2\n3\n" > file
264 $ hg add file
264 $ hg add file
265 $ hg commit -m '1+2+3'
265 $ hg commit -m '1+2+3'
266 $ echo 4 >> file
266 $ echo 4 >> file
267 $ hg commit -m '+4'
267 $ hg commit -m '+4'
268 $ echo 5 >> file
268 $ echo 5 >> file
269 $ hg commit -m '+5'
269 $ hg commit -m '+5'
270 $ echo 6 >> file
270 $ echo 6 >> file
271 $ hg commit -m '+6'
271 $ hg commit -m '+6'
272 $ hg logt --graph
272 $ hg logt --graph
273 @ 3:251d831eeec5 +6
273 @ 3:251d831eeec5 +6
274 |
274 |
275 o 2:888f9082bf99 +5
275 o 2:888f9082bf99 +5
276 |
276 |
277 o 1:617f94f13c0f +4
277 o 1:617f94f13c0f +4
278 |
278 |
279 o 0:0189ba417d34 1+2+3
279 o 0:0189ba417d34 1+2+3
280
280
281
281
282 $ hg histedit 1 --commands - << EOF
282 $ hg histedit 1 --commands - << EOF
283 > pick 617f94f13c0f 1 +4
283 > pick 617f94f13c0f 1 +4
284 > drop 888f9082bf99 2 +5
284 > drop 888f9082bf99 2 +5
285 > fold 251d831eeec5 3 +6
285 > fold 251d831eeec5 3 +6
286 > EOF
286 > EOF
287 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
287 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
288 merging file
288 merging file
289 warning: conflicts during merge.
289 warning: conflicts during merge.
290 merging file incomplete! (edit conflicts, then use 'hg resolve --mark')
290 merging file incomplete! (edit conflicts, then use 'hg resolve --mark')
291 Fix up the change and run hg histedit --continue
291 Fix up the change and run hg histedit --continue
292 [1]
292 [1]
293 There were conflicts, we keep P1 content. This
293 There were conflicts, we keep P1 content. This
294 should effectively drop the changes from +6.
294 should effectively drop the changes from +6.
295 $ hg status
295 $ hg status
296 M file
296 M file
297 ? file.orig
297 ? file.orig
298 $ hg resolve -l
298 $ hg resolve -l
299 U file
299 U file
300 $ hg revert -r 'p1()' file
300 $ hg revert -r 'p1()' file
301 $ hg resolve --mark file
301 $ hg resolve --mark file
302 (no more unresolved files)
302 (no more unresolved files)
303 $ hg histedit --continue
303 $ hg histedit --continue
304 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
304 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
305 saved backup bundle to $TESTTMP/*-backup.hg (glob)
305 saved backup bundle to $TESTTMP/*-backup.hg (glob)
306 $ hg logt --graph
306 $ hg logt --graph
307 @ 1:617f94f13c0f +4
307 @ 1:617f94f13c0f +4
308 |
308 |
309 o 0:0189ba417d34 1+2+3
309 o 0:0189ba417d34 1+2+3
310
310
311
311
312 $ cd ..
312 $ cd ..
313
313
314
314
315 Test fold through dropped
315 Test fold through dropped
316 -------------------------
316 -------------------------
317
317
318
318
319 Test corner case where folded revision is separated from its parent by a
319 Test corner case where folded revision is separated from its parent by a
320 dropped revision.
320 dropped revision.
321
321
322
322
323 $ hg init fold-with-dropped
323 $ hg init fold-with-dropped
324 $ cd fold-with-dropped
324 $ cd fold-with-dropped
325 $ printf "1\n2\n3\n" > file
325 $ printf "1\n2\n3\n" > file
326 $ hg commit -Am '1+2+3'
326 $ hg commit -Am '1+2+3'
327 adding file
327 adding file
328 $ echo 4 >> file
328 $ echo 4 >> file
329 $ hg commit -m '+4'
329 $ hg commit -m '+4'
330 $ echo 5 >> file
330 $ echo 5 >> file
331 $ hg commit -m '+5'
331 $ hg commit -m '+5'
332 $ echo 6 >> file
332 $ echo 6 >> file
333 $ hg commit -m '+6'
333 $ hg commit -m '+6'
334 $ hg logt -G
334 $ hg logt -G
335 @ 3:251d831eeec5 +6
335 @ 3:251d831eeec5 +6
336 |
336 |
337 o 2:888f9082bf99 +5
337 o 2:888f9082bf99 +5
338 |
338 |
339 o 1:617f94f13c0f +4
339 o 1:617f94f13c0f +4
340 |
340 |
341 o 0:0189ba417d34 1+2+3
341 o 0:0189ba417d34 1+2+3
342
342
343 $ hg histedit 1 --commands - << EOF
343 $ hg histedit 1 --commands - << EOF
344 > pick 617f94f13c0f 1 +4
344 > pick 617f94f13c0f 1 +4
345 > drop 888f9082bf99 2 +5
345 > drop 888f9082bf99 2 +5
346 > fold 251d831eeec5 3 +6
346 > fold 251d831eeec5 3 +6
347 > EOF
347 > EOF
348 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
348 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
349 merging file
349 merging file
350 warning: conflicts during merge.
350 warning: conflicts during merge.
351 merging file incomplete! (edit conflicts, then use 'hg resolve --mark')
351 merging file incomplete! (edit conflicts, then use 'hg resolve --mark')
352 Fix up the change and run hg histedit --continue
352 Fix up the change and run hg histedit --continue
353 [1]
353 [1]
354 $ cat > file << EOF
354 $ cat > file << EOF
355 > 1
355 > 1
356 > 2
356 > 2
357 > 3
357 > 3
358 > 4
358 > 4
359 > 5
359 > 5
360 > EOF
360 > EOF
361 $ hg resolve --mark file
361 $ hg resolve --mark file
362 (no more unresolved files)
362 (no more unresolved files)
363 $ hg commit -m '+5.2'
363 $ hg commit -m '+5.2'
364 created new head
364 created new head
365 $ echo 6 >> file
365 $ echo 6 >> file
366 $ HGEDITOR=cat hg histedit --continue
366 $ HGEDITOR=cat hg histedit --continue
367 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
367 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
368 +4
368 +4
369 ***
369 ***
370 +5.2
370 +5.2
371 ***
371 ***
372 +6
372 +6
373
373
374
374
375
375
376 HG: Enter commit message. Lines beginning with 'HG:' are removed.
376 HG: Enter commit message. Lines beginning with 'HG:' are removed.
377 HG: Leave message empty to abort commit.
377 HG: Leave message empty to abort commit.
378 HG: --
378 HG: --
379 HG: user: test
379 HG: user: test
380 HG: branch 'default'
380 HG: branch 'default'
381 HG: changed file
381 HG: changed file
382 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
382 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
383 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
383 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
384 saved backup bundle to $TESTTMP/fold-with-dropped/.hg/strip-backup/617f94f13c0f-backup.hg (glob)
384 saved backup bundle to $TESTTMP/fold-with-dropped/.hg/strip-backup/617f94f13c0f-backup.hg (glob)
385 $ hg logt -G
385 $ hg logt -G
386 @ 1:10c647b2cdd5 +4
386 @ 1:10c647b2cdd5 +4
387 |
387 |
388 o 0:0189ba417d34 1+2+3
388 o 0:0189ba417d34 1+2+3
389
389
390 $ hg export tip
390 $ hg export tip
391 # HG changeset patch
391 # HG changeset patch
392 # User test
392 # User test
393 # Date 0 0
393 # Date 0 0
394 # Thu Jan 01 00:00:00 1970 +0000
394 # Thu Jan 01 00:00:00 1970 +0000
395 # Node ID 10c647b2cdd54db0603ecb99b2ff5ce66d5a5323
395 # Node ID 10c647b2cdd54db0603ecb99b2ff5ce66d5a5323
396 # Parent 0189ba417d34df9dda55f88b637dcae9917b5964
396 # Parent 0189ba417d34df9dda55f88b637dcae9917b5964
397 +4
397 +4
398 ***
398 ***
399 +5.2
399 +5.2
400 ***
400 ***
401 +6
401 +6
402
402
403 diff -r 0189ba417d34 -r 10c647b2cdd5 file
403 diff -r 0189ba417d34 -r 10c647b2cdd5 file
404 --- a/file Thu Jan 01 00:00:00 1970 +0000
404 --- a/file Thu Jan 01 00:00:00 1970 +0000
405 +++ b/file Thu Jan 01 00:00:00 1970 +0000
405 +++ b/file Thu Jan 01 00:00:00 1970 +0000
406 @@ -1,3 +1,6 @@
406 @@ -1,3 +1,6 @@
407 1
407 1
408 2
408 2
409 3
409 3
410 +4
410 +4
411 +5
411 +5
412 +6
412 +6
413 $ cd ..
413 $ cd ..
414
414
415
415
416 Folding with initial rename (issue3729)
416 Folding with initial rename (issue3729)
417 ---------------------------------------
417 ---------------------------------------
418
418
419 $ hg init fold-rename
419 $ hg init fold-rename
420 $ cd fold-rename
420 $ cd fold-rename
421 $ echo a > a.txt
421 $ echo a > a.txt
422 $ hg add a.txt
422 $ hg add a.txt
423 $ hg commit -m a
423 $ hg commit -m a
424 $ hg rename a.txt b.txt
424 $ hg rename a.txt b.txt
425 $ hg commit -m rename
425 $ hg commit -m rename
426 $ echo b >> b.txt
426 $ echo b >> b.txt
427 $ hg commit -m b
427 $ hg commit -m b
428
428
429 $ hg logt --follow b.txt
429 $ hg logt --follow b.txt
430 2:e0371e0426bc b
430 2:e0371e0426bc b
431 1:1c4f440a8085 rename
431 1:1c4f440a8085 rename
432 0:6c795aa153cb a
432 0:6c795aa153cb a
433
433
434 $ hg histedit 1c4f440a8085 --commands - 2>&1 << EOF | fixbundle
434 $ hg histedit 1c4f440a8085 --commands - 2>&1 << EOF | fixbundle
435 > pick 1c4f440a8085 rename
435 > pick 1c4f440a8085 rename
436 > fold e0371e0426bc b
436 > fold e0371e0426bc b
437 > EOF
437 > EOF
438 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
438 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
439 reverting b.txt
439 reverting b.txt
440 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
440 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
441 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
441 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
442 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
442 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
443
443
444 $ hg logt --follow b.txt
444 $ hg logt --follow b.txt
445 1:cf858d235c76 rename
445 1:cf858d235c76 rename
446 0:6c795aa153cb a
446 0:6c795aa153cb a
447
447
448 $ cd ..
448 $ cd ..
449
449
450 Folding with swapping
450 Folding with swapping
451 ---------------------
451 ---------------------
452
452
453 This is an excuse to test hook with histedit temporary commit (issue4422)
453 This is an excuse to test hook with histedit temporary commit (issue4422)
454
454
455
455
456 $ hg init issue4422
456 $ hg init issue4422
457 $ cd issue4422
457 $ cd issue4422
458 $ echo a > a.txt
458 $ echo a > a.txt
459 $ hg add a.txt
459 $ hg add a.txt
460 $ hg commit -m a
460 $ hg commit -m a
461 $ echo b > b.txt
461 $ echo b > b.txt
462 $ hg add b.txt
462 $ hg add b.txt
463 $ hg commit -m b
463 $ hg commit -m b
464 $ echo c > c.txt
464 $ echo c > c.txt
465 $ hg add c.txt
465 $ hg add c.txt
466 $ hg commit -m c
466 $ hg commit -m c
467
467
468 $ hg logt
468 $ hg logt
469 2:a1a953ffb4b0 c
469 2:a1a953ffb4b0 c
470 1:199b6bb90248 b
470 1:199b6bb90248 b
471 0:6c795aa153cb a
471 0:6c795aa153cb a
472
472
473 $ hg histedit 6c795aa153cb --config hooks.commit="echo commit \$HG_NODE" --commands - 2>&1 << EOF | fixbundle
473 Setup the proper environment variable symbol for the platform, to be subbed
474 into the hook command.
475 #if windows
476 $ NODE="%HG_NODE%"
477 #else
478 $ NODE="\$HG_NODE"
479 #endif
480 $ hg histedit 6c795aa153cb --config hooks.commit="echo commit $NODE" --commands - 2>&1 << EOF | fixbundle
474 > pick 199b6bb90248 b
481 > pick 199b6bb90248 b
475 > fold a1a953ffb4b0 c
482 > fold a1a953ffb4b0 c
476 > pick 6c795aa153cb a
483 > pick 6c795aa153cb a
477 > EOF
484 > EOF
478 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
485 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
479 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
486 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
480 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
487 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
481 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
488 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
482 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
489 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
483 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
490 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
484 commit 9599899f62c05f4377548c32bf1c9f1a39634b0c
491 commit 9599899f62c05f4377548c32bf1c9f1a39634b0c
485
492
486 $ hg logt
493 $ hg logt
487 1:9599899f62c0 a
494 1:9599899f62c0 a
488 0:79b99e9c8e49 b
495 0:79b99e9c8e49 b
489
496
490 $ cd ..
497 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now