##// END OF EJS Templates
split: add test demonstrating issue with empty splits adjusting phases...
Kyle Lippincott -
r47684:17368844 default
parent child Browse files
Show More
@@ -1,1048 +1,1162 b''
1 #testcases obsstore-on obsstore-off
1 #testcases obsstore-on obsstore-off
2
2
3 $ cat > $TESTTMP/editor.py <<EOF
3 $ cat > $TESTTMP/editor.py <<EOF
4 > #!"$PYTHON"
4 > #!"$PYTHON"
5 > import os
5 > import os
6 > import sys
6 > import sys
7 > path = os.path.join(os.environ['TESTTMP'], 'messages')
7 > path = os.path.join(os.environ['TESTTMP'], 'messages')
8 > messages = open(path).read().split('--\n')
8 > messages = open(path).read().split('--\n')
9 > prompt = open(sys.argv[1]).read()
9 > prompt = open(sys.argv[1]).read()
10 > sys.stdout.write(''.join('EDITOR: %s' % l for l in prompt.splitlines(True)))
10 > sys.stdout.write(''.join('EDITOR: %s' % l for l in prompt.splitlines(True)))
11 > sys.stdout.flush()
11 > sys.stdout.flush()
12 > with open(sys.argv[1], 'w') as f:
12 > with open(sys.argv[1], 'w') as f:
13 > f.write(messages[0])
13 > f.write(messages[0])
14 > with open(path, 'w') as f:
14 > with open(path, 'w') as f:
15 > f.write('--\n'.join(messages[1:]))
15 > f.write('--\n'.join(messages[1:]))
16 > EOF
16 > EOF
17
17
18 $ cat >> $HGRCPATH <<EOF
18 $ cat >> $HGRCPATH <<EOF
19 > [extensions]
19 > [extensions]
20 > drawdag=$TESTDIR/drawdag.py
20 > drawdag=$TESTDIR/drawdag.py
21 > split=
21 > split=
22 > [ui]
22 > [ui]
23 > interactive=1
23 > interactive=1
24 > color=no
24 > color=no
25 > paginate=never
25 > paginate=never
26 > [diff]
26 > [diff]
27 > git=1
27 > git=1
28 > unified=0
28 > unified=0
29 > [commands]
29 > [commands]
30 > commit.interactive.unified=0
30 > commit.interactive.unified=0
31 > [alias]
31 > [alias]
32 > glog=log -G -T '{rev}:{node|short} {desc} {bookmarks}\n'
32 > glog=log -G -T '{rev}:{node|short} {desc} {bookmarks}\n'
33 > EOF
33 > EOF
34
34
35 #if obsstore-on
35 #if obsstore-on
36 $ cat >> $HGRCPATH <<EOF
36 $ cat >> $HGRCPATH <<EOF
37 > [experimental]
37 > [experimental]
38 > evolution=all
38 > evolution=all
39 > EOF
39 > EOF
40 #endif
40 #endif
41
41
42 $ hg init a
42 $ hg init a
43 $ cd a
43 $ cd a
44
44
45 Nothing to split
45 Nothing to split
46
46
47 $ hg split
47 $ hg split
48 nothing to split
48 nothing to split
49 [1]
49 [1]
50
50
51 $ hg commit -m empty --config ui.allowemptycommit=1
51 $ hg commit -m empty --config ui.allowemptycommit=1
52 $ hg split
52 $ hg split
53 abort: cannot split an empty revision
53 abort: cannot split an empty revision
54 [10]
54 [10]
55
55
56 $ rm -rf .hg
56 $ rm -rf .hg
57 $ hg init
57 $ hg init
58
58
59 Cannot split working directory
59 Cannot split working directory
60
60
61 $ hg split -r 'wdir()'
61 $ hg split -r 'wdir()'
62 abort: cannot split working directory
62 abort: cannot split working directory
63 [10]
63 [10]
64
64
65 Generate some content. The sed filter drop CR on Windows, which is dropped in
65 Generate some content. The sed filter drop CR on Windows, which is dropped in
66 the a > b line.
66 the a > b line.
67
67
68 $ $TESTDIR/seq.py 1 5 | sed 's/\r$//' >> a
68 $ $TESTDIR/seq.py 1 5 | sed 's/\r$//' >> a
69 $ hg ci -m a1 -A a -q
69 $ hg ci -m a1 -A a -q
70 $ hg bookmark -i r1
70 $ hg bookmark -i r1
71 $ sed 's/1/11/;s/3/33/;s/5/55/' a > b
71 $ sed 's/1/11/;s/3/33/;s/5/55/' a > b
72 $ mv b a
72 $ mv b a
73 $ hg ci -m a2 -q
73 $ hg ci -m a2 -q
74 $ hg bookmark -i r2
74 $ hg bookmark -i r2
75
75
76 Cannot split a public changeset
76 Cannot split a public changeset
77
77
78 $ hg phase --public -r 'all()'
78 $ hg phase --public -r 'all()'
79 $ hg split .
79 $ hg split .
80 abort: cannot split public changesets
80 abort: cannot split public changesets
81 (see 'hg help phases' for details)
81 (see 'hg help phases' for details)
82 [10]
82 [10]
83
83
84 $ hg phase --draft -f -r 'all()'
84 $ hg phase --draft -f -r 'all()'
85
85
86 Cannot split while working directory is dirty
86 Cannot split while working directory is dirty
87
87
88 $ touch dirty
88 $ touch dirty
89 $ hg add dirty
89 $ hg add dirty
90 $ hg split .
90 $ hg split .
91 abort: uncommitted changes
91 abort: uncommitted changes
92 [20]
92 [20]
93 $ hg forget dirty
93 $ hg forget dirty
94 $ rm dirty
94 $ rm dirty
95
95
96 Make a clean directory for future tests to build off of
96 Make a clean directory for future tests to build off of
97
97
98 $ cp -R . ../clean
98 $ cp -R . ../clean
99
99
100 Split a head
100 Split a head
101
101
102 $ hg bookmark r3
102 $ hg bookmark r3
103
103
104 $ hg split 'all()'
104 $ hg split 'all()'
105 abort: cannot split multiple revisions
105 abort: cannot split multiple revisions
106 [10]
106 [10]
107
107
108 This function splits a bit strangely primarily to avoid changing the behavior of
108 This function splits a bit strangely primarily to avoid changing the behavior of
109 the test after a bug was fixed with how split/commit --interactive handled
109 the test after a bug was fixed with how split/commit --interactive handled
110 `commands.commit.interactive.unified=0`: when there were no context lines,
110 `commands.commit.interactive.unified=0`: when there were no context lines,
111 it kept only the last diff hunk. When running split, this meant that runsplit
111 it kept only the last diff hunk. When running split, this meant that runsplit
112 was always recording three commits, one for each diff hunk, in reverse order
112 was always recording three commits, one for each diff hunk, in reverse order
113 (the base commit was the last diff hunk in the file).
113 (the base commit was the last diff hunk in the file).
114 $ runsplit() {
114 $ runsplit() {
115 > cat > $TESTTMP/messages <<EOF
115 > cat > $TESTTMP/messages <<EOF
116 > split 1
116 > split 1
117 > --
117 > --
118 > split 2
118 > split 2
119 > --
119 > --
120 > split 3
120 > split 3
121 > EOF
121 > EOF
122 > cat <<EOF | hg split "$@"
122 > cat <<EOF | hg split "$@"
123 > y
123 > y
124 > n
124 > n
125 > n
125 > n
126 > y
126 > y
127 > y
127 > y
128 > n
128 > n
129 > y
129 > y
130 > y
130 > y
131 > y
131 > y
132 > EOF
132 > EOF
133 > }
133 > }
134
134
135 $ HGEDITOR=false runsplit
135 $ HGEDITOR=false runsplit
136 diff --git a/a b/a
136 diff --git a/a b/a
137 3 hunks, 3 lines changed
137 3 hunks, 3 lines changed
138 examine changes to 'a'?
138 examine changes to 'a'?
139 (enter ? for help) [Ynesfdaq?] y
139 (enter ? for help) [Ynesfdaq?] y
140
140
141 @@ -1,1 +1,1 @@
141 @@ -1,1 +1,1 @@
142 -1
142 -1
143 +11
143 +11
144 record change 1/3 to 'a'?
144 record change 1/3 to 'a'?
145 (enter ? for help) [Ynesfdaq?] n
145 (enter ? for help) [Ynesfdaq?] n
146
146
147 @@ -3,1 +3,1 @@ 2
147 @@ -3,1 +3,1 @@ 2
148 -3
148 -3
149 +33
149 +33
150 record change 2/3 to 'a'?
150 record change 2/3 to 'a'?
151 (enter ? for help) [Ynesfdaq?] n
151 (enter ? for help) [Ynesfdaq?] n
152
152
153 @@ -5,1 +5,1 @@ 4
153 @@ -5,1 +5,1 @@ 4
154 -5
154 -5
155 +55
155 +55
156 record change 3/3 to 'a'?
156 record change 3/3 to 'a'?
157 (enter ? for help) [Ynesfdaq?] y
157 (enter ? for help) [Ynesfdaq?] y
158
158
159 transaction abort!
159 transaction abort!
160 rollback completed
160 rollback completed
161 abort: edit failed: false exited with status 1
161 abort: edit failed: false exited with status 1
162 [250]
162 [250]
163 $ hg status
163 $ hg status
164
164
165 $ HGEDITOR="\"$PYTHON\" $TESTTMP/editor.py"
165 $ HGEDITOR="\"$PYTHON\" $TESTTMP/editor.py"
166 $ runsplit
166 $ runsplit
167 diff --git a/a b/a
167 diff --git a/a b/a
168 3 hunks, 3 lines changed
168 3 hunks, 3 lines changed
169 examine changes to 'a'?
169 examine changes to 'a'?
170 (enter ? for help) [Ynesfdaq?] y
170 (enter ? for help) [Ynesfdaq?] y
171
171
172 @@ -1,1 +1,1 @@
172 @@ -1,1 +1,1 @@
173 -1
173 -1
174 +11
174 +11
175 record change 1/3 to 'a'?
175 record change 1/3 to 'a'?
176 (enter ? for help) [Ynesfdaq?] n
176 (enter ? for help) [Ynesfdaq?] n
177
177
178 @@ -3,1 +3,1 @@ 2
178 @@ -3,1 +3,1 @@ 2
179 -3
179 -3
180 +33
180 +33
181 record change 2/3 to 'a'?
181 record change 2/3 to 'a'?
182 (enter ? for help) [Ynesfdaq?] n
182 (enter ? for help) [Ynesfdaq?] n
183
183
184 @@ -5,1 +5,1 @@ 4
184 @@ -5,1 +5,1 @@ 4
185 -5
185 -5
186 +55
186 +55
187 record change 3/3 to 'a'?
187 record change 3/3 to 'a'?
188 (enter ? for help) [Ynesfdaq?] y
188 (enter ? for help) [Ynesfdaq?] y
189
189
190 EDITOR: HG: Splitting 1df0d5c5a3ab. Write commit message for the first split changeset.
190 EDITOR: HG: Splitting 1df0d5c5a3ab. Write commit message for the first split changeset.
191 EDITOR: a2
191 EDITOR: a2
192 EDITOR:
192 EDITOR:
193 EDITOR:
193 EDITOR:
194 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
194 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
195 EDITOR: HG: Leave message empty to abort commit.
195 EDITOR: HG: Leave message empty to abort commit.
196 EDITOR: HG: --
196 EDITOR: HG: --
197 EDITOR: HG: user: test
197 EDITOR: HG: user: test
198 EDITOR: HG: branch 'default'
198 EDITOR: HG: branch 'default'
199 EDITOR: HG: changed a
199 EDITOR: HG: changed a
200 created new head
200 created new head
201 diff --git a/a b/a
201 diff --git a/a b/a
202 2 hunks, 2 lines changed
202 2 hunks, 2 lines changed
203 examine changes to 'a'?
203 examine changes to 'a'?
204 (enter ? for help) [Ynesfdaq?] y
204 (enter ? for help) [Ynesfdaq?] y
205
205
206 @@ -1,1 +1,1 @@
206 @@ -1,1 +1,1 @@
207 -1
207 -1
208 +11
208 +11
209 record change 1/2 to 'a'?
209 record change 1/2 to 'a'?
210 (enter ? for help) [Ynesfdaq?] n
210 (enter ? for help) [Ynesfdaq?] n
211
211
212 @@ -3,1 +3,1 @@ 2
212 @@ -3,1 +3,1 @@ 2
213 -3
213 -3
214 +33
214 +33
215 record change 2/2 to 'a'?
215 record change 2/2 to 'a'?
216 (enter ? for help) [Ynesfdaq?] y
216 (enter ? for help) [Ynesfdaq?] y
217
217
218 EDITOR: HG: Splitting 1df0d5c5a3ab. So far it has been split into:
218 EDITOR: HG: Splitting 1df0d5c5a3ab. So far it has been split into:
219 EDITOR: HG: - 2:e704349bd21b tip "split 1"
219 EDITOR: HG: - 2:e704349bd21b tip "split 1"
220 EDITOR: HG: Write commit message for the next split changeset.
220 EDITOR: HG: Write commit message for the next split changeset.
221 EDITOR: a2
221 EDITOR: a2
222 EDITOR:
222 EDITOR:
223 EDITOR:
223 EDITOR:
224 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
224 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
225 EDITOR: HG: Leave message empty to abort commit.
225 EDITOR: HG: Leave message empty to abort commit.
226 EDITOR: HG: --
226 EDITOR: HG: --
227 EDITOR: HG: user: test
227 EDITOR: HG: user: test
228 EDITOR: HG: branch 'default'
228 EDITOR: HG: branch 'default'
229 EDITOR: HG: changed a
229 EDITOR: HG: changed a
230 diff --git a/a b/a
230 diff --git a/a b/a
231 1 hunks, 1 lines changed
231 1 hunks, 1 lines changed
232 examine changes to 'a'?
232 examine changes to 'a'?
233 (enter ? for help) [Ynesfdaq?] y
233 (enter ? for help) [Ynesfdaq?] y
234
234
235 @@ -1,1 +1,1 @@
235 @@ -1,1 +1,1 @@
236 -1
236 -1
237 +11
237 +11
238 record this change to 'a'?
238 record this change to 'a'?
239 (enter ? for help) [Ynesfdaq?] y
239 (enter ? for help) [Ynesfdaq?] y
240
240
241 EDITOR: HG: Splitting 1df0d5c5a3ab. So far it has been split into:
241 EDITOR: HG: Splitting 1df0d5c5a3ab. So far it has been split into:
242 EDITOR: HG: - 2:e704349bd21b tip "split 1"
242 EDITOR: HG: - 2:e704349bd21b tip "split 1"
243 EDITOR: HG: - 3:a09ad58faae3 "split 2"
243 EDITOR: HG: - 3:a09ad58faae3 "split 2"
244 EDITOR: HG: Write commit message for the next split changeset.
244 EDITOR: HG: Write commit message for the next split changeset.
245 EDITOR: a2
245 EDITOR: a2
246 EDITOR:
246 EDITOR:
247 EDITOR:
247 EDITOR:
248 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
248 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
249 EDITOR: HG: Leave message empty to abort commit.
249 EDITOR: HG: Leave message empty to abort commit.
250 EDITOR: HG: --
250 EDITOR: HG: --
251 EDITOR: HG: user: test
251 EDITOR: HG: user: test
252 EDITOR: HG: branch 'default'
252 EDITOR: HG: branch 'default'
253 EDITOR: HG: changed a
253 EDITOR: HG: changed a
254 saved backup bundle to $TESTTMP/a/.hg/strip-backup/1df0d5c5a3ab-8341b760-split.hg (obsstore-off !)
254 saved backup bundle to $TESTTMP/a/.hg/strip-backup/1df0d5c5a3ab-8341b760-split.hg (obsstore-off !)
255
255
256 #if obsstore-off
256 #if obsstore-off
257 $ hg bookmark
257 $ hg bookmark
258 r1 0:a61bcde8c529
258 r1 0:a61bcde8c529
259 r2 3:00eebaf8d2e2
259 r2 3:00eebaf8d2e2
260 * r3 3:00eebaf8d2e2
260 * r3 3:00eebaf8d2e2
261 $ hg glog -p
261 $ hg glog -p
262 @ 3:00eebaf8d2e2 split 3 r2 r3
262 @ 3:00eebaf8d2e2 split 3 r2 r3
263 | diff --git a/a b/a
263 | diff --git a/a b/a
264 | --- a/a
264 | --- a/a
265 | +++ b/a
265 | +++ b/a
266 | @@ -1,1 +1,1 @@
266 | @@ -1,1 +1,1 @@
267 | -1
267 | -1
268 | +11
268 | +11
269 |
269 |
270 o 2:a09ad58faae3 split 2
270 o 2:a09ad58faae3 split 2
271 | diff --git a/a b/a
271 | diff --git a/a b/a
272 | --- a/a
272 | --- a/a
273 | +++ b/a
273 | +++ b/a
274 | @@ -3,1 +3,1 @@
274 | @@ -3,1 +3,1 @@
275 | -3
275 | -3
276 | +33
276 | +33
277 |
277 |
278 o 1:e704349bd21b split 1
278 o 1:e704349bd21b split 1
279 | diff --git a/a b/a
279 | diff --git a/a b/a
280 | --- a/a
280 | --- a/a
281 | +++ b/a
281 | +++ b/a
282 | @@ -5,1 +5,1 @@
282 | @@ -5,1 +5,1 @@
283 | -5
283 | -5
284 | +55
284 | +55
285 |
285 |
286 o 0:a61bcde8c529 a1 r1
286 o 0:a61bcde8c529 a1 r1
287 diff --git a/a b/a
287 diff --git a/a b/a
288 new file mode 100644
288 new file mode 100644
289 --- /dev/null
289 --- /dev/null
290 +++ b/a
290 +++ b/a
291 @@ -0,0 +1,5 @@
291 @@ -0,0 +1,5 @@
292 +1
292 +1
293 +2
293 +2
294 +3
294 +3
295 +4
295 +4
296 +5
296 +5
297
297
298 #else
298 #else
299 $ hg bookmark
299 $ hg bookmark
300 r1 0:a61bcde8c529
300 r1 0:a61bcde8c529
301 r2 4:00eebaf8d2e2
301 r2 4:00eebaf8d2e2
302 * r3 4:00eebaf8d2e2
302 * r3 4:00eebaf8d2e2
303 $ hg glog
303 $ hg glog
304 @ 4:00eebaf8d2e2 split 3 r2 r3
304 @ 4:00eebaf8d2e2 split 3 r2 r3
305 |
305 |
306 o 3:a09ad58faae3 split 2
306 o 3:a09ad58faae3 split 2
307 |
307 |
308 o 2:e704349bd21b split 1
308 o 2:e704349bd21b split 1
309 |
309 |
310 o 0:a61bcde8c529 a1 r1
310 o 0:a61bcde8c529 a1 r1
311
311
312 #endif
312 #endif
313
313
314 Split a head while working parent is not that head
314 Split a head while working parent is not that head
315
315
316 $ cp -R $TESTTMP/clean $TESTTMP/b
316 $ cp -R $TESTTMP/clean $TESTTMP/b
317 $ cd $TESTTMP/b
317 $ cd $TESTTMP/b
318
318
319 $ hg up 0 -q
319 $ hg up 0 -q
320 $ hg bookmark r3
320 $ hg bookmark r3
321
321
322 $ runsplit tip >/dev/null
322 $ runsplit tip >/dev/null
323
323
324 #if obsstore-off
324 #if obsstore-off
325 $ hg bookmark
325 $ hg bookmark
326 r1 0:a61bcde8c529
326 r1 0:a61bcde8c529
327 r2 3:00eebaf8d2e2
327 r2 3:00eebaf8d2e2
328 * r3 0:a61bcde8c529
328 * r3 0:a61bcde8c529
329 $ hg glog
329 $ hg glog
330 o 3:00eebaf8d2e2 split 3 r2
330 o 3:00eebaf8d2e2 split 3 r2
331 |
331 |
332 o 2:a09ad58faae3 split 2
332 o 2:a09ad58faae3 split 2
333 |
333 |
334 o 1:e704349bd21b split 1
334 o 1:e704349bd21b split 1
335 |
335 |
336 @ 0:a61bcde8c529 a1 r1 r3
336 @ 0:a61bcde8c529 a1 r1 r3
337
337
338 #else
338 #else
339 $ hg bookmark
339 $ hg bookmark
340 r1 0:a61bcde8c529
340 r1 0:a61bcde8c529
341 r2 4:00eebaf8d2e2
341 r2 4:00eebaf8d2e2
342 * r3 0:a61bcde8c529
342 * r3 0:a61bcde8c529
343 $ hg glog
343 $ hg glog
344 o 4:00eebaf8d2e2 split 3 r2
344 o 4:00eebaf8d2e2 split 3 r2
345 |
345 |
346 o 3:a09ad58faae3 split 2
346 o 3:a09ad58faae3 split 2
347 |
347 |
348 o 2:e704349bd21b split 1
348 o 2:e704349bd21b split 1
349 |
349 |
350 @ 0:a61bcde8c529 a1 r1 r3
350 @ 0:a61bcde8c529 a1 r1 r3
351
351
352 #endif
352 #endif
353
353
354 Split a non-head
354 Split a non-head
355
355
356 $ cp -R $TESTTMP/clean $TESTTMP/c
356 $ cp -R $TESTTMP/clean $TESTTMP/c
357 $ cd $TESTTMP/c
357 $ cd $TESTTMP/c
358 $ echo d > d
358 $ echo d > d
359 $ hg ci -m d1 -A d
359 $ hg ci -m d1 -A d
360 $ hg bookmark -i d1
360 $ hg bookmark -i d1
361 $ echo 2 >> d
361 $ echo 2 >> d
362 $ hg ci -m d2
362 $ hg ci -m d2
363 $ echo 3 >> d
363 $ echo 3 >> d
364 $ hg ci -m d3
364 $ hg ci -m d3
365 $ hg bookmark -i d3
365 $ hg bookmark -i d3
366 $ hg up '.^' -q
366 $ hg up '.^' -q
367 $ hg bookmark d2
367 $ hg bookmark d2
368 $ cp -R . ../d
368 $ cp -R . ../d
369
369
370 $ runsplit -r 1 | grep rebasing
370 $ runsplit -r 1 | grep rebasing
371 rebasing 2:b5c5ea414030 d1 "d1"
371 rebasing 2:b5c5ea414030 d1 "d1"
372 rebasing 3:f4a0a8d004cc d2 "d2"
372 rebasing 3:f4a0a8d004cc d2 "d2"
373 rebasing 4:777940761eba d3 "d3"
373 rebasing 4:777940761eba d3 "d3"
374 #if obsstore-off
374 #if obsstore-off
375 $ hg bookmark
375 $ hg bookmark
376 d1 4:c4b449ef030e
376 d1 4:c4b449ef030e
377 * d2 5:c9dd00ab36a3
377 * d2 5:c9dd00ab36a3
378 d3 6:19f476bc865c
378 d3 6:19f476bc865c
379 r1 0:a61bcde8c529
379 r1 0:a61bcde8c529
380 r2 3:00eebaf8d2e2
380 r2 3:00eebaf8d2e2
381 $ hg glog -p
381 $ hg glog -p
382 o 6:19f476bc865c d3 d3
382 o 6:19f476bc865c d3 d3
383 | diff --git a/d b/d
383 | diff --git a/d b/d
384 | --- a/d
384 | --- a/d
385 | +++ b/d
385 | +++ b/d
386 | @@ -2,0 +3,1 @@
386 | @@ -2,0 +3,1 @@
387 | +3
387 | +3
388 |
388 |
389 @ 5:c9dd00ab36a3 d2 d2
389 @ 5:c9dd00ab36a3 d2 d2
390 | diff --git a/d b/d
390 | diff --git a/d b/d
391 | --- a/d
391 | --- a/d
392 | +++ b/d
392 | +++ b/d
393 | @@ -1,0 +2,1 @@
393 | @@ -1,0 +2,1 @@
394 | +2
394 | +2
395 |
395 |
396 o 4:c4b449ef030e d1 d1
396 o 4:c4b449ef030e d1 d1
397 | diff --git a/d b/d
397 | diff --git a/d b/d
398 | new file mode 100644
398 | new file mode 100644
399 | --- /dev/null
399 | --- /dev/null
400 | +++ b/d
400 | +++ b/d
401 | @@ -0,0 +1,1 @@
401 | @@ -0,0 +1,1 @@
402 | +d
402 | +d
403 |
403 |
404 o 3:00eebaf8d2e2 split 3 r2
404 o 3:00eebaf8d2e2 split 3 r2
405 | diff --git a/a b/a
405 | diff --git a/a b/a
406 | --- a/a
406 | --- a/a
407 | +++ b/a
407 | +++ b/a
408 | @@ -1,1 +1,1 @@
408 | @@ -1,1 +1,1 @@
409 | -1
409 | -1
410 | +11
410 | +11
411 |
411 |
412 o 2:a09ad58faae3 split 2
412 o 2:a09ad58faae3 split 2
413 | diff --git a/a b/a
413 | diff --git a/a b/a
414 | --- a/a
414 | --- a/a
415 | +++ b/a
415 | +++ b/a
416 | @@ -3,1 +3,1 @@
416 | @@ -3,1 +3,1 @@
417 | -3
417 | -3
418 | +33
418 | +33
419 |
419 |
420 o 1:e704349bd21b split 1
420 o 1:e704349bd21b split 1
421 | diff --git a/a b/a
421 | diff --git a/a b/a
422 | --- a/a
422 | --- a/a
423 | +++ b/a
423 | +++ b/a
424 | @@ -5,1 +5,1 @@
424 | @@ -5,1 +5,1 @@
425 | -5
425 | -5
426 | +55
426 | +55
427 |
427 |
428 o 0:a61bcde8c529 a1 r1
428 o 0:a61bcde8c529 a1 r1
429 diff --git a/a b/a
429 diff --git a/a b/a
430 new file mode 100644
430 new file mode 100644
431 --- /dev/null
431 --- /dev/null
432 +++ b/a
432 +++ b/a
433 @@ -0,0 +1,5 @@
433 @@ -0,0 +1,5 @@
434 +1
434 +1
435 +2
435 +2
436 +3
436 +3
437 +4
437 +4
438 +5
438 +5
439
439
440 #else
440 #else
441 $ hg bookmark
441 $ hg bookmark
442 d1 8:c4b449ef030e
442 d1 8:c4b449ef030e
443 * d2 9:c9dd00ab36a3
443 * d2 9:c9dd00ab36a3
444 d3 10:19f476bc865c
444 d3 10:19f476bc865c
445 r1 0:a61bcde8c529
445 r1 0:a61bcde8c529
446 r2 7:00eebaf8d2e2
446 r2 7:00eebaf8d2e2
447 $ hg glog
447 $ hg glog
448 o 10:19f476bc865c d3 d3
448 o 10:19f476bc865c d3 d3
449 |
449 |
450 @ 9:c9dd00ab36a3 d2 d2
450 @ 9:c9dd00ab36a3 d2 d2
451 |
451 |
452 o 8:c4b449ef030e d1 d1
452 o 8:c4b449ef030e d1 d1
453 |
453 |
454 o 7:00eebaf8d2e2 split 3 r2
454 o 7:00eebaf8d2e2 split 3 r2
455 |
455 |
456 o 6:a09ad58faae3 split 2
456 o 6:a09ad58faae3 split 2
457 |
457 |
458 o 5:e704349bd21b split 1
458 o 5:e704349bd21b split 1
459 |
459 |
460 o 0:a61bcde8c529 a1 r1
460 o 0:a61bcde8c529 a1 r1
461
461
462 #endif
462 #endif
463
463
464 Split a non-head without rebase
464 Split a non-head without rebase
465
465
466 $ cd $TESTTMP/d
466 $ cd $TESTTMP/d
467 #if obsstore-off
467 #if obsstore-off
468 $ runsplit -r 1 --no-rebase
468 $ runsplit -r 1 --no-rebase
469 abort: cannot split changeset with children
469 abort: cannot split changeset with children
470 [10]
470 [10]
471 #else
471 #else
472 $ runsplit -r 1 --no-rebase >/dev/null
472 $ runsplit -r 1 --no-rebase >/dev/null
473 3 new orphan changesets
473 3 new orphan changesets
474 $ hg bookmark
474 $ hg bookmark
475 d1 2:b5c5ea414030
475 d1 2:b5c5ea414030
476 * d2 3:f4a0a8d004cc
476 * d2 3:f4a0a8d004cc
477 d3 4:777940761eba
477 d3 4:777940761eba
478 r1 0:a61bcde8c529
478 r1 0:a61bcde8c529
479 r2 7:00eebaf8d2e2
479 r2 7:00eebaf8d2e2
480
480
481 $ hg glog
481 $ hg glog
482 o 7:00eebaf8d2e2 split 3 r2
482 o 7:00eebaf8d2e2 split 3 r2
483 |
483 |
484 o 6:a09ad58faae3 split 2
484 o 6:a09ad58faae3 split 2
485 |
485 |
486 o 5:e704349bd21b split 1
486 o 5:e704349bd21b split 1
487 |
487 |
488 | * 4:777940761eba d3 d3
488 | * 4:777940761eba d3 d3
489 | |
489 | |
490 | @ 3:f4a0a8d004cc d2 d2
490 | @ 3:f4a0a8d004cc d2 d2
491 | |
491 | |
492 | * 2:b5c5ea414030 d1 d1
492 | * 2:b5c5ea414030 d1 d1
493 | |
493 | |
494 | x 1:1df0d5c5a3ab a2
494 | x 1:1df0d5c5a3ab a2
495 |/
495 |/
496 o 0:a61bcde8c529 a1 r1
496 o 0:a61bcde8c529 a1 r1
497
497
498 #endif
498 #endif
499
499
500 Split a non-head with obsoleted descendants
500 Split a non-head with obsoleted descendants
501
501
502 #if obsstore-on
502 #if obsstore-on
503 $ hg init $TESTTMP/e
503 $ hg init $TESTTMP/e
504 $ cd $TESTTMP/e
504 $ cd $TESTTMP/e
505 $ hg debugdrawdag <<'EOS'
505 $ hg debugdrawdag <<'EOS'
506 > H I J
506 > H I J
507 > | | |
507 > | | |
508 > F G1 G2 # amend: G1 -> G2
508 > F G1 G2 # amend: G1 -> G2
509 > | | / # prune: F
509 > | | / # prune: F
510 > C D E
510 > C D E
511 > \|/
511 > \|/
512 > B
512 > B
513 > |
513 > |
514 > A
514 > A
515 > EOS
515 > EOS
516 2 new orphan changesets
516 2 new orphan changesets
517 $ eval `hg tags -T '{tag}={node}\n'`
517 $ eval `hg tags -T '{tag}={node}\n'`
518 $ rm .hg/localtags
518 $ rm .hg/localtags
519 $ hg split $B --config experimental.evolution=createmarkers
519 $ hg split $B --config experimental.evolution=createmarkers
520 abort: cannot split changeset with children
520 abort: cannot split changeset with children
521 [10]
521 [10]
522 $ cat > $TESTTMP/messages <<EOF
522 $ cat > $TESTTMP/messages <<EOF
523 > Split B
523 > Split B
524 > EOF
524 > EOF
525 $ cat <<EOF | hg split $B
525 $ cat <<EOF | hg split $B
526 > y
526 > y
527 > y
527 > y
528 > EOF
528 > EOF
529 diff --git a/B b/B
529 diff --git a/B b/B
530 new file mode 100644
530 new file mode 100644
531 examine changes to 'B'?
531 examine changes to 'B'?
532 (enter ? for help) [Ynesfdaq?] y
532 (enter ? for help) [Ynesfdaq?] y
533
533
534 @@ -0,0 +1,1 @@
534 @@ -0,0 +1,1 @@
535 +B
535 +B
536 \ No newline at end of file
536 \ No newline at end of file
537 record this change to 'B'?
537 record this change to 'B'?
538 (enter ? for help) [Ynesfdaq?] y
538 (enter ? for help) [Ynesfdaq?] y
539
539
540 EDITOR: HG: Splitting 112478962961. Write commit message for the first split changeset.
540 EDITOR: HG: Splitting 112478962961. Write commit message for the first split changeset.
541 EDITOR: B
541 EDITOR: B
542 EDITOR:
542 EDITOR:
543 EDITOR:
543 EDITOR:
544 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
544 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
545 EDITOR: HG: Leave message empty to abort commit.
545 EDITOR: HG: Leave message empty to abort commit.
546 EDITOR: HG: --
546 EDITOR: HG: --
547 EDITOR: HG: user: test
547 EDITOR: HG: user: test
548 EDITOR: HG: branch 'default'
548 EDITOR: HG: branch 'default'
549 EDITOR: HG: added B
549 EDITOR: HG: added B
550 created new head
550 created new head
551 rebasing 2:26805aba1e60 "C"
551 rebasing 2:26805aba1e60 "C"
552 rebasing 3:be0ef73c17ad "D"
552 rebasing 3:be0ef73c17ad "D"
553 rebasing 4:49cb92066bfd "E"
553 rebasing 4:49cb92066bfd "E"
554 rebasing 7:97a6268cc7ef "G2"
554 rebasing 7:97a6268cc7ef "G2"
555 rebasing 10:e2f1e425c0db "J"
555 rebasing 10:e2f1e425c0db "J"
556 $ hg glog -r 'sort(all(), topo)'
556 $ hg glog -r 'sort(all(), topo)'
557 o 16:556c085f8b52 J
557 o 16:556c085f8b52 J
558 |
558 |
559 o 15:8761f6c9123f G2
559 o 15:8761f6c9123f G2
560 |
560 |
561 o 14:a7aeffe59b65 E
561 o 14:a7aeffe59b65 E
562 |
562 |
563 | o 13:e1e914ede9ab D
563 | o 13:e1e914ede9ab D
564 |/
564 |/
565 | o 12:01947e9b98aa C
565 | o 12:01947e9b98aa C
566 |/
566 |/
567 o 11:0947baa74d47 Split B
567 o 11:0947baa74d47 Split B
568 |
568 |
569 | * 9:88ede1d5ee13 I
569 | * 9:88ede1d5ee13 I
570 | |
570 | |
571 | x 6:af8cbf225b7b G1
571 | x 6:af8cbf225b7b G1
572 | |
572 | |
573 | x 3:be0ef73c17ad D
573 | x 3:be0ef73c17ad D
574 | |
574 | |
575 | | * 8:74863e5b5074 H
575 | | * 8:74863e5b5074 H
576 | | |
576 | | |
577 | | x 5:ee481a2a1e69 F
577 | | x 5:ee481a2a1e69 F
578 | | |
578 | | |
579 | | x 2:26805aba1e60 C
579 | | x 2:26805aba1e60 C
580 | |/
580 | |/
581 | x 1:112478962961 B
581 | x 1:112478962961 B
582 |/
582 |/
583 o 0:426bada5c675 A
583 o 0:426bada5c675 A
584
584
585 #endif
585 #endif
586
586
587 Preserve secret phase in split
587 Preserve secret phase in split
588
588
589 $ cp -R $TESTTMP/clean $TESTTMP/phases1
589 $ cp -R $TESTTMP/clean $TESTTMP/phases1
590 $ cd $TESTTMP/phases1
590 $ cd $TESTTMP/phases1
591 $ hg phase --secret -fr tip
591 $ hg phase --secret -fr tip
592 $ hg log -T '{short(node)} {phase}\n'
592 $ hg log -T '{short(node)} {phase}\n'
593 1df0d5c5a3ab secret
593 1df0d5c5a3ab secret
594 a61bcde8c529 draft
594 a61bcde8c529 draft
595 $ runsplit tip >/dev/null
595 $ runsplit tip >/dev/null
596 $ hg log -T '{short(node)} {phase}\n'
596 $ hg log -T '{short(node)} {phase}\n'
597 00eebaf8d2e2 secret
597 00eebaf8d2e2 secret
598 a09ad58faae3 secret
598 a09ad58faae3 secret
599 e704349bd21b secret
599 e704349bd21b secret
600 a61bcde8c529 draft
600 a61bcde8c529 draft
601
601
602 Do not move things to secret even if phases.new-commit=secret
602 Do not move things to secret even if phases.new-commit=secret
603
603
604 $ cp -R $TESTTMP/clean $TESTTMP/phases2
604 $ cp -R $TESTTMP/clean $TESTTMP/phases2
605 $ cd $TESTTMP/phases2
605 $ cd $TESTTMP/phases2
606 $ cat >> .hg/hgrc <<EOF
606 $ cat >> .hg/hgrc <<EOF
607 > [phases]
607 > [phases]
608 > new-commit=secret
608 > new-commit=secret
609 > EOF
609 > EOF
610 $ hg log -T '{short(node)} {phase}\n'
610 $ hg log -T '{short(node)} {phase}\n'
611 1df0d5c5a3ab draft
611 1df0d5c5a3ab draft
612 a61bcde8c529 draft
612 a61bcde8c529 draft
613 $ runsplit tip >/dev/null
613 $ runsplit tip >/dev/null
614 $ hg log -T '{short(node)} {phase}\n'
614 $ hg log -T '{short(node)} {phase}\n'
615 00eebaf8d2e2 draft
615 00eebaf8d2e2 draft
616 a09ad58faae3 draft
616 a09ad58faae3 draft
617 e704349bd21b draft
617 e704349bd21b draft
618 a61bcde8c529 draft
618 a61bcde8c529 draft
619
619
620 `hg split` with ignoreblanklines=1 does not infinite loop
620 `hg split` with ignoreblanklines=1 does not infinite loop
621
621
622 $ mkdir $TESTTMP/f
622 $ mkdir $TESTTMP/f
623 $ hg init $TESTTMP/f/a
623 $ hg init $TESTTMP/f/a
624 $ cd $TESTTMP/f/a
624 $ cd $TESTTMP/f/a
625 $ printf '1\n2\n3\n4\n5\n' > foo
625 $ printf '1\n2\n3\n4\n5\n' > foo
626 $ cp foo bar
626 $ cp foo bar
627 $ hg ci -qAm initial
627 $ hg ci -qAm initial
628 $ printf '1\n\n2\n3\ntest\n4\n5\n' > bar
628 $ printf '1\n\n2\n3\ntest\n4\n5\n' > bar
629 $ printf '1\n2\n3\ntest\n4\n5\n' > foo
629 $ printf '1\n2\n3\ntest\n4\n5\n' > foo
630 $ hg ci -qm splitme
630 $ hg ci -qm splitme
631 $ cat > $TESTTMP/messages <<EOF
631 $ cat > $TESTTMP/messages <<EOF
632 > split 1
632 > split 1
633 > --
633 > --
634 > split 2
634 > split 2
635 > EOF
635 > EOF
636 $ printf 'f\nn\nf\n' | hg --config extensions.split= --config diff.ignoreblanklines=1 split
636 $ printf 'f\nn\nf\n' | hg --config extensions.split= --config diff.ignoreblanklines=1 split
637 diff --git a/bar b/bar
637 diff --git a/bar b/bar
638 2 hunks, 2 lines changed
638 2 hunks, 2 lines changed
639 examine changes to 'bar'?
639 examine changes to 'bar'?
640 (enter ? for help) [Ynesfdaq?] f
640 (enter ? for help) [Ynesfdaq?] f
641
641
642 diff --git a/foo b/foo
642 diff --git a/foo b/foo
643 1 hunks, 1 lines changed
643 1 hunks, 1 lines changed
644 examine changes to 'foo'?
644 examine changes to 'foo'?
645 (enter ? for help) [Ynesfdaq?] n
645 (enter ? for help) [Ynesfdaq?] n
646
646
647 EDITOR: HG: Splitting dd3c45017cbf. Write commit message for the first split changeset.
647 EDITOR: HG: Splitting dd3c45017cbf. Write commit message for the first split changeset.
648 EDITOR: splitme
648 EDITOR: splitme
649 EDITOR:
649 EDITOR:
650 EDITOR:
650 EDITOR:
651 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
651 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
652 EDITOR: HG: Leave message empty to abort commit.
652 EDITOR: HG: Leave message empty to abort commit.
653 EDITOR: HG: --
653 EDITOR: HG: --
654 EDITOR: HG: user: test
654 EDITOR: HG: user: test
655 EDITOR: HG: branch 'default'
655 EDITOR: HG: branch 'default'
656 EDITOR: HG: changed bar
656 EDITOR: HG: changed bar
657 created new head
657 created new head
658 diff --git a/foo b/foo
658 diff --git a/foo b/foo
659 1 hunks, 1 lines changed
659 1 hunks, 1 lines changed
660 examine changes to 'foo'?
660 examine changes to 'foo'?
661 (enter ? for help) [Ynesfdaq?] f
661 (enter ? for help) [Ynesfdaq?] f
662
662
663 EDITOR: HG: Splitting dd3c45017cbf. So far it has been split into:
663 EDITOR: HG: Splitting dd3c45017cbf. So far it has been split into:
664 EDITOR: HG: - 2:f205aea1c624 tip "split 1"
664 EDITOR: HG: - 2:f205aea1c624 tip "split 1"
665 EDITOR: HG: Write commit message for the next split changeset.
665 EDITOR: HG: Write commit message for the next split changeset.
666 EDITOR: splitme
666 EDITOR: splitme
667 EDITOR:
667 EDITOR:
668 EDITOR:
668 EDITOR:
669 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
669 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
670 EDITOR: HG: Leave message empty to abort commit.
670 EDITOR: HG: Leave message empty to abort commit.
671 EDITOR: HG: --
671 EDITOR: HG: --
672 EDITOR: HG: user: test
672 EDITOR: HG: user: test
673 EDITOR: HG: branch 'default'
673 EDITOR: HG: branch 'default'
674 EDITOR: HG: changed foo
674 EDITOR: HG: changed foo
675 saved backup bundle to $TESTTMP/f/a/.hg/strip-backup/dd3c45017cbf-463441b5-split.hg (obsstore-off !)
675 saved backup bundle to $TESTTMP/f/a/.hg/strip-backup/dd3c45017cbf-463441b5-split.hg (obsstore-off !)
676
676
677 Let's try that again, with a slightly different set of patches, to ensure that
677 Let's try that again, with a slightly different set of patches, to ensure that
678 the ignoreblanklines thing isn't somehow position dependent.
678 the ignoreblanklines thing isn't somehow position dependent.
679
679
680 $ hg init $TESTTMP/f/b
680 $ hg init $TESTTMP/f/b
681 $ cd $TESTTMP/f/b
681 $ cd $TESTTMP/f/b
682 $ printf '1\n2\n3\n4\n5\n' > foo
682 $ printf '1\n2\n3\n4\n5\n' > foo
683 $ cp foo bar
683 $ cp foo bar
684 $ hg ci -qAm initial
684 $ hg ci -qAm initial
685 $ printf '1\n2\n3\ntest\n4\n5\n' > bar
685 $ printf '1\n2\n3\ntest\n4\n5\n' > bar
686 $ printf '1\n2\n3\ntest\n4\n\n5\n' > foo
686 $ printf '1\n2\n3\ntest\n4\n\n5\n' > foo
687 $ hg ci -qm splitme
687 $ hg ci -qm splitme
688 $ cat > $TESTTMP/messages <<EOF
688 $ cat > $TESTTMP/messages <<EOF
689 > split 1
689 > split 1
690 > --
690 > --
691 > split 2
691 > split 2
692 > EOF
692 > EOF
693 $ printf 'f\nn\nf\n' | hg --config extensions.split= --config diff.ignoreblanklines=1 split
693 $ printf 'f\nn\nf\n' | hg --config extensions.split= --config diff.ignoreblanklines=1 split
694 diff --git a/bar b/bar
694 diff --git a/bar b/bar
695 1 hunks, 1 lines changed
695 1 hunks, 1 lines changed
696 examine changes to 'bar'?
696 examine changes to 'bar'?
697 (enter ? for help) [Ynesfdaq?] f
697 (enter ? for help) [Ynesfdaq?] f
698
698
699 diff --git a/foo b/foo
699 diff --git a/foo b/foo
700 2 hunks, 2 lines changed
700 2 hunks, 2 lines changed
701 examine changes to 'foo'?
701 examine changes to 'foo'?
702 (enter ? for help) [Ynesfdaq?] n
702 (enter ? for help) [Ynesfdaq?] n
703
703
704 EDITOR: HG: Splitting 904c80b40a4a. Write commit message for the first split changeset.
704 EDITOR: HG: Splitting 904c80b40a4a. Write commit message for the first split changeset.
705 EDITOR: splitme
705 EDITOR: splitme
706 EDITOR:
706 EDITOR:
707 EDITOR:
707 EDITOR:
708 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
708 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
709 EDITOR: HG: Leave message empty to abort commit.
709 EDITOR: HG: Leave message empty to abort commit.
710 EDITOR: HG: --
710 EDITOR: HG: --
711 EDITOR: HG: user: test
711 EDITOR: HG: user: test
712 EDITOR: HG: branch 'default'
712 EDITOR: HG: branch 'default'
713 EDITOR: HG: changed bar
713 EDITOR: HG: changed bar
714 created new head
714 created new head
715 diff --git a/foo b/foo
715 diff --git a/foo b/foo
716 2 hunks, 2 lines changed
716 2 hunks, 2 lines changed
717 examine changes to 'foo'?
717 examine changes to 'foo'?
718 (enter ? for help) [Ynesfdaq?] f
718 (enter ? for help) [Ynesfdaq?] f
719
719
720 EDITOR: HG: Splitting 904c80b40a4a. So far it has been split into:
720 EDITOR: HG: Splitting 904c80b40a4a. So far it has been split into:
721 EDITOR: HG: - 2:ffecf40fa954 tip "split 1"
721 EDITOR: HG: - 2:ffecf40fa954 tip "split 1"
722 EDITOR: HG: Write commit message for the next split changeset.
722 EDITOR: HG: Write commit message for the next split changeset.
723 EDITOR: splitme
723 EDITOR: splitme
724 EDITOR:
724 EDITOR:
725 EDITOR:
725 EDITOR:
726 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
726 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
727 EDITOR: HG: Leave message empty to abort commit.
727 EDITOR: HG: Leave message empty to abort commit.
728 EDITOR: HG: --
728 EDITOR: HG: --
729 EDITOR: HG: user: test
729 EDITOR: HG: user: test
730 EDITOR: HG: branch 'default'
730 EDITOR: HG: branch 'default'
731 EDITOR: HG: changed foo
731 EDITOR: HG: changed foo
732 saved backup bundle to $TESTTMP/f/b/.hg/strip-backup/904c80b40a4a-47fb907f-split.hg (obsstore-off !)
732 saved backup bundle to $TESTTMP/f/b/.hg/strip-backup/904c80b40a4a-47fb907f-split.hg (obsstore-off !)
733
733
734
734
735 Testing the case in split when commiting flag-only file changes (issue5864)
735 Testing the case in split when commiting flag-only file changes (issue5864)
736 ---------------------------------------------------------------------------
736 ---------------------------------------------------------------------------
737 $ hg init $TESTTMP/issue5864
737 $ hg init $TESTTMP/issue5864
738 $ cd $TESTTMP/issue5864
738 $ cd $TESTTMP/issue5864
739 $ echo foo > foo
739 $ echo foo > foo
740 $ hg add foo
740 $ hg add foo
741 $ hg ci -m "initial"
741 $ hg ci -m "initial"
742 $ hg import -q --bypass -m "make executable" - <<EOF
742 $ hg import -q --bypass -m "make executable" - <<EOF
743 > diff --git a/foo b/foo
743 > diff --git a/foo b/foo
744 > old mode 100644
744 > old mode 100644
745 > new mode 100755
745 > new mode 100755
746 > EOF
746 > EOF
747 $ hg up -q
747 $ hg up -q
748
748
749 $ hg glog
749 $ hg glog
750 @ 1:3a2125f0f4cb make executable
750 @ 1:3a2125f0f4cb make executable
751 |
751 |
752 o 0:51f273a58d82 initial
752 o 0:51f273a58d82 initial
753
753
754
754
755 #if no-windows
755 #if no-windows
756 $ cat > $TESTTMP/messages <<EOF
756 $ cat > $TESTTMP/messages <<EOF
757 > split 1
757 > split 1
758 > EOF
758 > EOF
759 $ printf 'y\n' | hg split
759 $ printf 'y\n' | hg split
760 diff --git a/foo b/foo
760 diff --git a/foo b/foo
761 old mode 100644
761 old mode 100644
762 new mode 100755
762 new mode 100755
763 examine changes to 'foo'?
763 examine changes to 'foo'?
764 (enter ? for help) [Ynesfdaq?] y
764 (enter ? for help) [Ynesfdaq?] y
765
765
766 EDITOR: HG: Splitting 3a2125f0f4cb. Write commit message for the first split changeset.
766 EDITOR: HG: Splitting 3a2125f0f4cb. Write commit message for the first split changeset.
767 EDITOR: make executable
767 EDITOR: make executable
768 EDITOR:
768 EDITOR:
769 EDITOR:
769 EDITOR:
770 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
770 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
771 EDITOR: HG: Leave message empty to abort commit.
771 EDITOR: HG: Leave message empty to abort commit.
772 EDITOR: HG: --
772 EDITOR: HG: --
773 EDITOR: HG: user: test
773 EDITOR: HG: user: test
774 EDITOR: HG: branch 'default'
774 EDITOR: HG: branch 'default'
775 EDITOR: HG: changed foo
775 EDITOR: HG: changed foo
776 created new head
776 created new head
777 saved backup bundle to $TESTTMP/issue5864/.hg/strip-backup/3a2125f0f4cb-629e4432-split.hg (obsstore-off !)
777 saved backup bundle to $TESTTMP/issue5864/.hg/strip-backup/3a2125f0f4cb-629e4432-split.hg (obsstore-off !)
778
778
779 $ hg log -G -T "{node|short} {desc}\n"
779 $ hg log -G -T "{node|short} {desc}\n"
780 @ b154670c87da split 1
780 @ b154670c87da split 1
781 |
781 |
782 o 51f273a58d82 initial
782 o 51f273a58d82 initial
783
783
784 #else
784 #else
785
785
786 TODO: Fix this on Windows. See issue 2020 and 5883
786 TODO: Fix this on Windows. See issue 2020 and 5883
787
787
788 $ printf 'y\ny\ny\n' | hg split
788 $ printf 'y\ny\ny\n' | hg split
789 abort: cannot split an empty revision
789 abort: cannot split an empty revision
790 [10]
790 [10]
791 #endif
791 #endif
792
792
793 Test that splitting moves works properly (issue5723)
793 Test that splitting moves works properly (issue5723)
794 ----------------------------------------------------
794 ----------------------------------------------------
795
795
796 $ hg init $TESTTMP/issue5723-mv
796 $ hg init $TESTTMP/issue5723-mv
797 $ cd $TESTTMP/issue5723-mv
797 $ cd $TESTTMP/issue5723-mv
798 $ printf '1\n2\n' > file
798 $ printf '1\n2\n' > file
799 $ hg ci -qAm initial
799 $ hg ci -qAm initial
800 $ hg mv file file2
800 $ hg mv file file2
801 $ printf 'a\nb\n1\n2\n3\n4\n' > file2
801 $ printf 'a\nb\n1\n2\n3\n4\n' > file2
802 $ cat > $TESTTMP/messages <<EOF
802 $ cat > $TESTTMP/messages <<EOF
803 > split1, keeping only the numbered lines
803 > split1, keeping only the numbered lines
804 > --
804 > --
805 > split2, keeping the lettered lines
805 > split2, keeping the lettered lines
806 > EOF
806 > EOF
807 $ hg ci -m 'move and modify'
807 $ hg ci -m 'move and modify'
808 $ printf 'y\nn\na\na\n' | hg split
808 $ printf 'y\nn\na\na\n' | hg split
809 diff --git a/file b/file2
809 diff --git a/file b/file2
810 rename from file
810 rename from file
811 rename to file2
811 rename to file2
812 2 hunks, 4 lines changed
812 2 hunks, 4 lines changed
813 examine changes to 'file' and 'file2'?
813 examine changes to 'file' and 'file2'?
814 (enter ? for help) [Ynesfdaq?] y
814 (enter ? for help) [Ynesfdaq?] y
815
815
816 @@ -0,0 +1,2 @@
816 @@ -0,0 +1,2 @@
817 +a
817 +a
818 +b
818 +b
819 record change 1/2 to 'file2'?
819 record change 1/2 to 'file2'?
820 (enter ? for help) [Ynesfdaq?] n
820 (enter ? for help) [Ynesfdaq?] n
821
821
822 @@ -2,0 +5,2 @@ 2
822 @@ -2,0 +5,2 @@ 2
823 +3
823 +3
824 +4
824 +4
825 record change 2/2 to 'file2'?
825 record change 2/2 to 'file2'?
826 (enter ? for help) [Ynesfdaq?] a
826 (enter ? for help) [Ynesfdaq?] a
827
827
828 EDITOR: HG: Splitting 8c42fa635116. Write commit message for the first split changeset.
828 EDITOR: HG: Splitting 8c42fa635116. Write commit message for the first split changeset.
829 EDITOR: move and modify
829 EDITOR: move and modify
830 EDITOR:
830 EDITOR:
831 EDITOR:
831 EDITOR:
832 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
832 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
833 EDITOR: HG: Leave message empty to abort commit.
833 EDITOR: HG: Leave message empty to abort commit.
834 EDITOR: HG: --
834 EDITOR: HG: --
835 EDITOR: HG: user: test
835 EDITOR: HG: user: test
836 EDITOR: HG: branch 'default'
836 EDITOR: HG: branch 'default'
837 EDITOR: HG: added file2
837 EDITOR: HG: added file2
838 EDITOR: HG: removed file
838 EDITOR: HG: removed file
839 created new head
839 created new head
840 diff --git a/file2 b/file2
840 diff --git a/file2 b/file2
841 1 hunks, 2 lines changed
841 1 hunks, 2 lines changed
842 examine changes to 'file2'?
842 examine changes to 'file2'?
843 (enter ? for help) [Ynesfdaq?] a
843 (enter ? for help) [Ynesfdaq?] a
844
844
845 EDITOR: HG: Splitting 8c42fa635116. So far it has been split into:
845 EDITOR: HG: Splitting 8c42fa635116. So far it has been split into:
846 EDITOR: HG: - 2:478be2a70c27 tip "split1, keeping only the numbered lines"
846 EDITOR: HG: - 2:478be2a70c27 tip "split1, keeping only the numbered lines"
847 EDITOR: HG: Write commit message for the next split changeset.
847 EDITOR: HG: Write commit message for the next split changeset.
848 EDITOR: move and modify
848 EDITOR: move and modify
849 EDITOR:
849 EDITOR:
850 EDITOR:
850 EDITOR:
851 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
851 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
852 EDITOR: HG: Leave message empty to abort commit.
852 EDITOR: HG: Leave message empty to abort commit.
853 EDITOR: HG: --
853 EDITOR: HG: --
854 EDITOR: HG: user: test
854 EDITOR: HG: user: test
855 EDITOR: HG: branch 'default'
855 EDITOR: HG: branch 'default'
856 EDITOR: HG: changed file2
856 EDITOR: HG: changed file2
857 saved backup bundle to $TESTTMP/issue5723-mv/.hg/strip-backup/8c42fa635116-a38044d4-split.hg (obsstore-off !)
857 saved backup bundle to $TESTTMP/issue5723-mv/.hg/strip-backup/8c42fa635116-a38044d4-split.hg (obsstore-off !)
858 $ hg log -T '{desc}: {files%"{file} "}\n'
858 $ hg log -T '{desc}: {files%"{file} "}\n'
859 split2, keeping the lettered lines: file2
859 split2, keeping the lettered lines: file2
860 split1, keeping only the numbered lines: file file2
860 split1, keeping only the numbered lines: file file2
861 initial: file
861 initial: file
862 $ cat file2
862 $ cat file2
863 a
863 a
864 b
864 b
865 1
865 1
866 2
866 2
867 3
867 3
868 4
868 4
869 $ hg cat -r ".^" file2
869 $ hg cat -r ".^" file2
870 1
870 1
871 2
871 2
872 3
872 3
873 4
873 4
874 $ hg cat -r . file2
874 $ hg cat -r . file2
875 a
875 a
876 b
876 b
877 1
877 1
878 2
878 2
879 3
879 3
880 4
880 4
881
881
882
882
883 Test that splitting copies works properly (issue5723)
883 Test that splitting copies works properly (issue5723)
884 ----------------------------------------------------
884 ----------------------------------------------------
885
885
886 $ hg init $TESTTMP/issue5723-cp
886 $ hg init $TESTTMP/issue5723-cp
887 $ cd $TESTTMP/issue5723-cp
887 $ cd $TESTTMP/issue5723-cp
888 $ printf '1\n2\n' > file
888 $ printf '1\n2\n' > file
889 $ hg ci -qAm initial
889 $ hg ci -qAm initial
890 $ hg cp file file2
890 $ hg cp file file2
891 $ printf 'a\nb\n1\n2\n3\n4\n' > file2
891 $ printf 'a\nb\n1\n2\n3\n4\n' > file2
892 Also modify 'file' to prove that the changes aren't being pulled in
892 Also modify 'file' to prove that the changes aren't being pulled in
893 accidentally.
893 accidentally.
894 $ printf 'this is the new contents of "file"' > file
894 $ printf 'this is the new contents of "file"' > file
895 $ cat > $TESTTMP/messages <<EOF
895 $ cat > $TESTTMP/messages <<EOF
896 > split1, keeping "file" and only the numbered lines in file2
896 > split1, keeping "file" and only the numbered lines in file2
897 > --
897 > --
898 > split2, keeping the lettered lines in file2
898 > split2, keeping the lettered lines in file2
899 > EOF
899 > EOF
900 $ hg ci -m 'copy file->file2, modify both'
900 $ hg ci -m 'copy file->file2, modify both'
901 $ printf 'f\ny\nn\na\na\n' | hg split
901 $ printf 'f\ny\nn\na\na\n' | hg split
902 diff --git a/file b/file
902 diff --git a/file b/file
903 1 hunks, 2 lines changed
903 1 hunks, 2 lines changed
904 examine changes to 'file'?
904 examine changes to 'file'?
905 (enter ? for help) [Ynesfdaq?] f
905 (enter ? for help) [Ynesfdaq?] f
906
906
907 diff --git a/file b/file2
907 diff --git a/file b/file2
908 copy from file
908 copy from file
909 copy to file2
909 copy to file2
910 2 hunks, 4 lines changed
910 2 hunks, 4 lines changed
911 examine changes to 'file' and 'file2'?
911 examine changes to 'file' and 'file2'?
912 (enter ? for help) [Ynesfdaq?] y
912 (enter ? for help) [Ynesfdaq?] y
913
913
914 @@ -0,0 +1,2 @@
914 @@ -0,0 +1,2 @@
915 +a
915 +a
916 +b
916 +b
917 record change 2/3 to 'file2'?
917 record change 2/3 to 'file2'?
918 (enter ? for help) [Ynesfdaq?] n
918 (enter ? for help) [Ynesfdaq?] n
919
919
920 @@ -2,0 +5,2 @@ 2
920 @@ -2,0 +5,2 @@ 2
921 +3
921 +3
922 +4
922 +4
923 record change 3/3 to 'file2'?
923 record change 3/3 to 'file2'?
924 (enter ? for help) [Ynesfdaq?] a
924 (enter ? for help) [Ynesfdaq?] a
925
925
926 EDITOR: HG: Splitting 41c861dfa61e. Write commit message for the first split changeset.
926 EDITOR: HG: Splitting 41c861dfa61e. Write commit message for the first split changeset.
927 EDITOR: copy file->file2, modify both
927 EDITOR: copy file->file2, modify both
928 EDITOR:
928 EDITOR:
929 EDITOR:
929 EDITOR:
930 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
930 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
931 EDITOR: HG: Leave message empty to abort commit.
931 EDITOR: HG: Leave message empty to abort commit.
932 EDITOR: HG: --
932 EDITOR: HG: --
933 EDITOR: HG: user: test
933 EDITOR: HG: user: test
934 EDITOR: HG: branch 'default'
934 EDITOR: HG: branch 'default'
935 EDITOR: HG: added file2
935 EDITOR: HG: added file2
936 EDITOR: HG: changed file
936 EDITOR: HG: changed file
937 created new head
937 created new head
938 diff --git a/file2 b/file2
938 diff --git a/file2 b/file2
939 1 hunks, 2 lines changed
939 1 hunks, 2 lines changed
940 examine changes to 'file2'?
940 examine changes to 'file2'?
941 (enter ? for help) [Ynesfdaq?] a
941 (enter ? for help) [Ynesfdaq?] a
942
942
943 EDITOR: HG: Splitting 41c861dfa61e. So far it has been split into:
943 EDITOR: HG: Splitting 41c861dfa61e. So far it has been split into:
944 EDITOR: HG: - 2:4b19e06610eb tip "split1, keeping "file" and only the numbered lines in file2"
944 EDITOR: HG: - 2:4b19e06610eb tip "split1, keeping "file" and only the numbered lines in file2"
945 EDITOR: HG: Write commit message for the next split changeset.
945 EDITOR: HG: Write commit message for the next split changeset.
946 EDITOR: copy file->file2, modify both
946 EDITOR: copy file->file2, modify both
947 EDITOR:
947 EDITOR:
948 EDITOR:
948 EDITOR:
949 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
949 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
950 EDITOR: HG: Leave message empty to abort commit.
950 EDITOR: HG: Leave message empty to abort commit.
951 EDITOR: HG: --
951 EDITOR: HG: --
952 EDITOR: HG: user: test
952 EDITOR: HG: user: test
953 EDITOR: HG: branch 'default'
953 EDITOR: HG: branch 'default'
954 EDITOR: HG: changed file2
954 EDITOR: HG: changed file2
955 saved backup bundle to $TESTTMP/issue5723-cp/.hg/strip-backup/41c861dfa61e-467e8d3c-split.hg (obsstore-off !)
955 saved backup bundle to $TESTTMP/issue5723-cp/.hg/strip-backup/41c861dfa61e-467e8d3c-split.hg (obsstore-off !)
956 $ hg log -T '{desc}: {files%"{file} "}\n'
956 $ hg log -T '{desc}: {files%"{file} "}\n'
957 split2, keeping the lettered lines in file2: file2
957 split2, keeping the lettered lines in file2: file2
958 split1, keeping "file" and only the numbered lines in file2: file file2
958 split1, keeping "file" and only the numbered lines in file2: file file2
959 initial: file
959 initial: file
960 $ cat file2
960 $ cat file2
961 a
961 a
962 b
962 b
963 1
963 1
964 2
964 2
965 3
965 3
966 4
966 4
967 $ hg cat -r ".^" file2
967 $ hg cat -r ".^" file2
968 1
968 1
969 2
969 2
970 3
970 3
971 4
971 4
972 $ hg cat -r . file2
972 $ hg cat -r . file2
973 a
973 a
974 b
974 b
975 1
975 1
976 2
976 2
977 3
977 3
978 4
978 4
979
979
980 Test that color codes don't end up in the commit message template
980 Test that color codes don't end up in the commit message template
981 ----------------------------------------------------
981 ----------------------------------------------------
982
982
983 $ hg init $TESTTMP/colorless
983 $ hg init $TESTTMP/colorless
984 $ cd $TESTTMP/colorless
984 $ cd $TESTTMP/colorless
985 $ echo 1 > file1
985 $ echo 1 > file1
986 $ echo 1 > file2
986 $ echo 1 > file2
987 $ hg ci -qAm initial
987 $ hg ci -qAm initial
988 $ echo 2 > file1
988 $ echo 2 > file1
989 $ echo 2 > file2
989 $ echo 2 > file2
990 $ cat > $TESTTMP/messages <<EOF
990 $ cat > $TESTTMP/messages <<EOF
991 > split1, modifying file1
991 > split1, modifying file1
992 > --
992 > --
993 > split2, modifying file2
993 > split2, modifying file2
994 > EOF
994 > EOF
995 $ hg ci
995 $ hg ci
996 EDITOR:
996 EDITOR:
997 EDITOR:
997 EDITOR:
998 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
998 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
999 EDITOR: HG: Leave message empty to abort commit.
999 EDITOR: HG: Leave message empty to abort commit.
1000 EDITOR: HG: --
1000 EDITOR: HG: --
1001 EDITOR: HG: user: test
1001 EDITOR: HG: user: test
1002 EDITOR: HG: branch 'default'
1002 EDITOR: HG: branch 'default'
1003 EDITOR: HG: changed file1
1003 EDITOR: HG: changed file1
1004 EDITOR: HG: changed file2
1004 EDITOR: HG: changed file2
1005 $ printf 'f\nn\na\n' | hg split --color=debug \
1005 $ printf 'f\nn\na\n' | hg split --color=debug \
1006 > --config command-templates.oneline-summary='{label("rev", rev)} {desc}'
1006 > --config command-templates.oneline-summary='{label("rev", rev)} {desc}'
1007 [diff.diffline|diff --git a/file1 b/file1]
1007 [diff.diffline|diff --git a/file1 b/file1]
1008 1 hunks, 1 lines changed
1008 1 hunks, 1 lines changed
1009 [ ui.prompt|examine changes to 'file1'?
1009 [ ui.prompt|examine changes to 'file1'?
1010 (enter ? for help) [Ynesfdaq?]] [ ui.promptecho|f]
1010 (enter ? for help) [Ynesfdaq?]] [ ui.promptecho|f]
1011
1011
1012 [diff.diffline|diff --git a/file2 b/file2]
1012 [diff.diffline|diff --git a/file2 b/file2]
1013 1 hunks, 1 lines changed
1013 1 hunks, 1 lines changed
1014 [ ui.prompt|examine changes to 'file2'?
1014 [ ui.prompt|examine changes to 'file2'?
1015 (enter ? for help) [Ynesfdaq?]] [ ui.promptecho|n]
1015 (enter ? for help) [Ynesfdaq?]] [ ui.promptecho|n]
1016
1016
1017 EDITOR: HG: Splitting 6432c65c3078. Write commit message for the first split changeset.
1017 EDITOR: HG: Splitting 6432c65c3078. Write commit message for the first split changeset.
1018 EDITOR: split1, modifying file1
1018 EDITOR: split1, modifying file1
1019 EDITOR:
1019 EDITOR:
1020 EDITOR:
1020 EDITOR:
1021 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
1021 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
1022 EDITOR: HG: Leave message empty to abort commit.
1022 EDITOR: HG: Leave message empty to abort commit.
1023 EDITOR: HG: --
1023 EDITOR: HG: --
1024 EDITOR: HG: user: test
1024 EDITOR: HG: user: test
1025 EDITOR: HG: branch 'default'
1025 EDITOR: HG: branch 'default'
1026 EDITOR: HG: changed file1
1026 EDITOR: HG: changed file1
1027 [ ui.status|created new head]
1027 [ ui.status|created new head]
1028 [diff.diffline|diff --git a/file2 b/file2]
1028 [diff.diffline|diff --git a/file2 b/file2]
1029 1 hunks, 1 lines changed
1029 1 hunks, 1 lines changed
1030 [ ui.prompt|examine changes to 'file2'?
1030 [ ui.prompt|examine changes to 'file2'?
1031 (enter ? for help) [Ynesfdaq?]] [ ui.promptecho|a]
1031 (enter ? for help) [Ynesfdaq?]] [ ui.promptecho|a]
1032
1032
1033 EDITOR: HG: Splitting 6432c65c3078. So far it has been split into:
1033 EDITOR: HG: Splitting 6432c65c3078. So far it has been split into:
1034 EDITOR: HG: - 2 split2, modifying file2
1034 EDITOR: HG: - 2 split2, modifying file2
1035 EDITOR: HG: Write commit message for the next split changeset.
1035 EDITOR: HG: Write commit message for the next split changeset.
1036 EDITOR: split1, modifying file1
1036 EDITOR: split1, modifying file1
1037 EDITOR:
1037 EDITOR:
1038 EDITOR:
1038 EDITOR:
1039 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
1039 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
1040 EDITOR: HG: Leave message empty to abort commit.
1040 EDITOR: HG: Leave message empty to abort commit.
1041 EDITOR: HG: --
1041 EDITOR: HG: --
1042 EDITOR: HG: user: test
1042 EDITOR: HG: user: test
1043 EDITOR: HG: branch 'default'
1043 EDITOR: HG: branch 'default'
1044 EDITOR: HG: changed file2
1044 EDITOR: HG: changed file2
1045 [ ui.warning|transaction abort!]
1045 [ ui.warning|transaction abort!]
1046 [ ui.warning|rollback completed]
1046 [ ui.warning|rollback completed]
1047 [ ui.error|abort: empty commit message]
1047 [ ui.error|abort: empty commit message]
1048 [10]
1048 [10]
1049
1050 Test that creating an empty split or "no-op"
1051 (identical to original) commit doesn't cause chaos
1052 --------------------------------------------------
1053
1054 $ hg init $TESTTMP/noop
1055 $ cd $TESTTMP/noop
1056 $ echo r0 > r0
1057 $ hg ci -qAm r0
1058 $ hg phase -p
1059 $ echo foo > foo
1060 $ hg ci -qAm foo
1061 $ hg log -G -T'{phase} {rev}:{node|short} {desc}'
1062 @ draft 1:ae694b2901bb foo
1063 |
1064 o public 0:222799e2f90b r0
1065
1066 FIXME: This should not show "So far it has been split into"
1067 $ printf 'd\na\n' | HGEDITOR=cat hg split || true
1068 diff --git a/foo b/foo
1069 new file mode 100644
1070 examine changes to 'foo'?
1071 (enter ? for help) [Ynesfdaq?] d
1072
1073 no changes to record
1074 diff --git a/foo b/foo
1075 new file mode 100644
1076 examine changes to 'foo'?
1077 (enter ? for help) [Ynesfdaq?] a
1078
1079 HG: Splitting ae694b2901bb. So far it has been split into:
1080 HG: - 0:222799e2f90b "r0"
1081 HG: Write commit message for the next split changeset.
1082 foo
1083
1084
1085 HG: Enter commit message. Lines beginning with 'HG:' are removed.
1086 HG: Leave message empty to abort commit.
1087 HG: --
1088 HG: user: test
1089 HG: branch 'default'
1090 HG: added foo
1091 warning: commit already existed in the repository!
1092 saved backup bundle to $TESTTMP/noop/.hg/strip-backup/ae694b2901bb-28e0b457-split.hg (obsstore-off !)
1093 transaction abort! (obsstore-on !)
1094 rollback completed (obsstore-on !)
1095 abort: changeset ae694b2901bb cannot obsolete itself (obsstore-on !)
1096 FIXME: this should not have stripped the commit we just no-op split
1097 (obsstore-off only), or made r0 draft.
1098 $ hg log -G -T'{phase} {rev}:{node|short} {desc}'
1099 warning: ignoring unknown working parent ae694b2901bb! (obsstore-off !)
1100 @ draft 1:ae694b2901bb foo (obsstore-on !)
1101 | (obsstore-on !)
1102 o public 0:222799e2f90b r0 (obsstore-on !)
1103 o draft 0:222799e2f90b r0 (obsstore-off !)
1104
1105
1106 Now try the same thing but modifying the message so we don't trigger the
1107 identical changeset failures
1108
1109 $ hg init $TESTTMP/noop2
1110 $ cd $TESTTMP/noop2
1111 $ echo r0 > r0
1112 $ hg ci -qAm r0
1113 $ hg phase -p
1114 $ echo foo > foo
1115 $ hg ci -qAm foo
1116 $ hg log -G -T'{phase} {rev}:{node|short} {desc}'
1117 @ draft 1:ae694b2901bb foo
1118 |
1119 o public 0:222799e2f90b r0
1120
1121 $ cat > $TESTTMP/messages <<EOF
1122 > message1
1123 > EOF
1124 FIXME: This should not show "So far it has been split into"
1125 $ printf 'd\na\n' | HGEDITOR="\"$PYTHON\" $TESTTMP/editor.py" hg split
1126 diff --git a/foo b/foo
1127 new file mode 100644
1128 examine changes to 'foo'?
1129 (enter ? for help) [Ynesfdaq?] d
1130
1131 no changes to record
1132 diff --git a/foo b/foo
1133 new file mode 100644
1134 examine changes to 'foo'?
1135 (enter ? for help) [Ynesfdaq?] a
1136
1137 EDITOR: HG: Splitting ae694b2901bb. So far it has been split into:
1138 EDITOR: HG: - 0:222799e2f90b "r0"
1139 EDITOR: HG: Write commit message for the next split changeset.
1140 EDITOR: foo
1141 EDITOR:
1142 EDITOR:
1143 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
1144 EDITOR: HG: Leave message empty to abort commit.
1145 EDITOR: HG: --
1146 EDITOR: HG: user: test
1147 EDITOR: HG: branch 'default'
1148 EDITOR: HG: added foo
1149 created new head
1150 saved backup bundle to $TESTTMP/noop2/.hg/strip-backup/ae694b2901bb-28e0b457-split.hg (obsstore-off !)
1151 FIXME: this should not have made r0 draft
1152 $ hg log -G -T'{phase} {rev}:{node|short} {desc}'
1153 @ draft 1:de675559d3f9 message1 (obsstore-off !)
1154 @ draft 2:de675559d3f9 message1 (obsstore-on !)
1155 |
1156 o draft 0:222799e2f90b r0
1157
1158 #if obsstore-on
1159 FIXME: this should not have marked 222799e (r0) as a precursor of anything.
1160 $ hg debugobsolete
1161 ae694b2901bb8b0f8c4b5e075ddec0d63468d57a 222799e2f90be09ccbe49f519c4615d8375a9242 de675559d3f93ffc822c6eb7490e5c73033f17c7 0 * (glob)
1162 #endif
General Comments 0
You need to be logged in to leave comments. Login now