##// END OF EJS Templates
rebase: add tests showing patch conflict detection needs to be smarter in IMM...
Pulkit Goyal -
r39611:aa022f88 default
parent child Browse files
Show More
@@ -1,584 +1,626 b''
1 #require symlink execbit
1 #require symlink execbit
2 $ cat << EOF >> $HGRCPATH
2 $ cat << EOF >> $HGRCPATH
3 > [extensions]
3 > [extensions]
4 > amend=
4 > amend=
5 > rebase=
5 > rebase=
6 > debugdrawdag=$TESTDIR/drawdag.py
6 > debugdrawdag=$TESTDIR/drawdag.py
7 > strip=
7 > strip=
8 > [rebase]
8 > [rebase]
9 > experimental.inmemory=1
9 > experimental.inmemory=1
10 > [diff]
10 > [diff]
11 > git=1
11 > git=1
12 > [alias]
12 > [alias]
13 > tglog = log -G --template "{rev}: {node|short} '{desc}'\n"
13 > tglog = log -G --template "{rev}: {node|short} '{desc}'\n"
14 > EOF
14 > EOF
15
15
16 Rebase a simple DAG:
16 Rebase a simple DAG:
17 $ hg init repo1
17 $ hg init repo1
18 $ cd repo1
18 $ cd repo1
19 $ hg debugdrawdag <<'EOS'
19 $ hg debugdrawdag <<'EOS'
20 > c b
20 > c b
21 > |/
21 > |/
22 > d
22 > d
23 > |
23 > |
24 > a
24 > a
25 > EOS
25 > EOS
26 $ hg up -C a
26 $ hg up -C a
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28 $ hg tglog
28 $ hg tglog
29 o 3: 814f6bd05178 'c'
29 o 3: 814f6bd05178 'c'
30 |
30 |
31 | o 2: db0e82a16a62 'b'
31 | o 2: db0e82a16a62 'b'
32 |/
32 |/
33 o 1: 02952614a83d 'd'
33 o 1: 02952614a83d 'd'
34 |
34 |
35 @ 0: b173517d0057 'a'
35 @ 0: b173517d0057 'a'
36
36
37 $ hg cat -r 3 c
37 $ hg cat -r 3 c
38 c (no-eol)
38 c (no-eol)
39 $ hg cat -r 2 b
39 $ hg cat -r 2 b
40 b (no-eol)
40 b (no-eol)
41 $ hg rebase --debug -r b -d c | grep rebasing
41 $ hg rebase --debug -r b -d c | grep rebasing
42 rebasing in-memory
42 rebasing in-memory
43 rebasing 2:db0e82a16a62 "b" (b)
43 rebasing 2:db0e82a16a62 "b" (b)
44 $ hg tglog
44 $ hg tglog
45 o 3: ca58782ad1e4 'b'
45 o 3: ca58782ad1e4 'b'
46 |
46 |
47 o 2: 814f6bd05178 'c'
47 o 2: 814f6bd05178 'c'
48 |
48 |
49 o 1: 02952614a83d 'd'
49 o 1: 02952614a83d 'd'
50 |
50 |
51 @ 0: b173517d0057 'a'
51 @ 0: b173517d0057 'a'
52
52
53 $ hg cat -r 3 b
53 $ hg cat -r 3 b
54 b (no-eol)
54 b (no-eol)
55 $ hg cat -r 2 c
55 $ hg cat -r 2 c
56 c (no-eol)
56 c (no-eol)
57
57
58 Case 2:
58 Case 2:
59 $ hg init repo2
59 $ hg init repo2
60 $ cd repo2
60 $ cd repo2
61 $ hg debugdrawdag <<'EOS'
61 $ hg debugdrawdag <<'EOS'
62 > c b
62 > c b
63 > |/
63 > |/
64 > d
64 > d
65 > |
65 > |
66 > a
66 > a
67 > EOS
67 > EOS
68
68
69 Add a symlink and executable file:
69 Add a symlink and executable file:
70 $ hg up -C c
70 $ hg up -C c
71 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
71 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
72 $ ln -s somefile e
72 $ ln -s somefile e
73 $ echo f > f
73 $ echo f > f
74 $ chmod +x f
74 $ chmod +x f
75 $ hg add e f
75 $ hg add e f
76 $ hg amend -q
76 $ hg amend -q
77 $ hg up -Cq a
77 $ hg up -Cq a
78
78
79 Write files to the working copy, and ensure they're still there after the rebase
79 Write files to the working copy, and ensure they're still there after the rebase
80 $ echo "abc" > a
80 $ echo "abc" > a
81 $ ln -s def b
81 $ ln -s def b
82 $ echo "ghi" > c
82 $ echo "ghi" > c
83 $ echo "jkl" > d
83 $ echo "jkl" > d
84 $ echo "mno" > e
84 $ echo "mno" > e
85 $ hg tglog
85 $ hg tglog
86 o 3: f56b71190a8f 'c'
86 o 3: f56b71190a8f 'c'
87 |
87 |
88 | o 2: db0e82a16a62 'b'
88 | o 2: db0e82a16a62 'b'
89 |/
89 |/
90 o 1: 02952614a83d 'd'
90 o 1: 02952614a83d 'd'
91 |
91 |
92 @ 0: b173517d0057 'a'
92 @ 0: b173517d0057 'a'
93
93
94 $ hg cat -r 3 c
94 $ hg cat -r 3 c
95 c (no-eol)
95 c (no-eol)
96 $ hg cat -r 2 b
96 $ hg cat -r 2 b
97 b (no-eol)
97 b (no-eol)
98 $ hg cat -r 3 e
98 $ hg cat -r 3 e
99 somefile (no-eol)
99 somefile (no-eol)
100 $ hg rebase --debug -s b -d a | grep rebasing
100 $ hg rebase --debug -s b -d a | grep rebasing
101 rebasing in-memory
101 rebasing in-memory
102 rebasing 2:db0e82a16a62 "b" (b)
102 rebasing 2:db0e82a16a62 "b" (b)
103 $ hg tglog
103 $ hg tglog
104 o 3: fc055c3b4d33 'b'
104 o 3: fc055c3b4d33 'b'
105 |
105 |
106 | o 2: f56b71190a8f 'c'
106 | o 2: f56b71190a8f 'c'
107 | |
107 | |
108 | o 1: 02952614a83d 'd'
108 | o 1: 02952614a83d 'd'
109 |/
109 |/
110 @ 0: b173517d0057 'a'
110 @ 0: b173517d0057 'a'
111
111
112 $ hg cat -r 2 c
112 $ hg cat -r 2 c
113 c (no-eol)
113 c (no-eol)
114 $ hg cat -r 3 b
114 $ hg cat -r 3 b
115 b (no-eol)
115 b (no-eol)
116 $ hg rebase --debug -s 1 -d 3 | grep rebasing
116 $ hg rebase --debug -s 1 -d 3 | grep rebasing
117 rebasing in-memory
117 rebasing in-memory
118 rebasing 1:02952614a83d "d" (d)
118 rebasing 1:02952614a83d "d" (d)
119 rebasing 2:f56b71190a8f "c"
119 rebasing 2:f56b71190a8f "c"
120 $ hg tglog
120 $ hg tglog
121 o 3: 753feb6fd12a 'c'
121 o 3: 753feb6fd12a 'c'
122 |
122 |
123 o 2: 09c044d2cb43 'd'
123 o 2: 09c044d2cb43 'd'
124 |
124 |
125 o 1: fc055c3b4d33 'b'
125 o 1: fc055c3b4d33 'b'
126 |
126 |
127 @ 0: b173517d0057 'a'
127 @ 0: b173517d0057 'a'
128
128
129 Ensure working copy files are still there:
129 Ensure working copy files are still there:
130 $ cat a
130 $ cat a
131 abc
131 abc
132 $ readlink.py b
132 $ readlink.py b
133 b -> def
133 b -> def
134 $ cat e
134 $ cat e
135 mno
135 mno
136
136
137 Ensure symlink and executable files were rebased properly:
137 Ensure symlink and executable files were rebased properly:
138 $ hg up -Cq 3
138 $ hg up -Cq 3
139 $ readlink.py e
139 $ readlink.py e
140 e -> somefile
140 e -> somefile
141 $ ls -l f | cut -c -10
141 $ ls -l f | cut -c -10
142 -rwxr-xr-x
142 -rwxr-xr-x
143
143
144 Rebase the working copy parent
144 Rebase the working copy parent
145 $ hg up -C 3
145 $ hg up -C 3
146 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
147 $ hg rebase -r 3 -d 0 --debug | grep rebasing
147 $ hg rebase -r 3 -d 0 --debug | grep rebasing
148 rebasing in-memory
148 rebasing in-memory
149 rebasing 3:753feb6fd12a "c" (tip)
149 rebasing 3:753feb6fd12a "c" (tip)
150 $ hg tglog
150 $ hg tglog
151 @ 3: 844a7de3e617 'c'
151 @ 3: 844a7de3e617 'c'
152 |
152 |
153 | o 2: 09c044d2cb43 'd'
153 | o 2: 09c044d2cb43 'd'
154 | |
154 | |
155 | o 1: fc055c3b4d33 'b'
155 | o 1: fc055c3b4d33 'b'
156 |/
156 |/
157 o 0: b173517d0057 'a'
157 o 0: b173517d0057 'a'
158
158
159
159
160 Test reporting of path conflicts
160 Test reporting of path conflicts
161
161
162 $ hg rm a
162 $ hg rm a
163 $ mkdir a
163 $ mkdir a
164 $ touch a/a
164 $ touch a/a
165 $ hg ci -Am "a/a"
165 $ hg ci -Am "a/a"
166 adding a/a
166 adding a/a
167 $ hg tglog
167 $ hg tglog
168 @ 4: daf7dfc139cb 'a/a'
168 @ 4: daf7dfc139cb 'a/a'
169 |
169 |
170 o 3: 844a7de3e617 'c'
170 o 3: 844a7de3e617 'c'
171 |
171 |
172 | o 2: 09c044d2cb43 'd'
172 | o 2: 09c044d2cb43 'd'
173 | |
173 | |
174 | o 1: fc055c3b4d33 'b'
174 | o 1: fc055c3b4d33 'b'
175 |/
175 |/
176 o 0: b173517d0057 'a'
176 o 0: b173517d0057 'a'
177
177
178 $ hg rebase -r . -d 2
178 $ hg rebase -r . -d 2
179 rebasing 4:daf7dfc139cb "a/a" (tip)
179 rebasing 4:daf7dfc139cb "a/a" (tip)
180 saved backup bundle to $TESTTMP/repo1/repo2/.hg/strip-backup/daf7dfc139cb-fdbfcf4f-rebase.hg
180 saved backup bundle to $TESTTMP/repo1/repo2/.hg/strip-backup/daf7dfc139cb-fdbfcf4f-rebase.hg
181
181
182 $ hg tglog
183 @ 4: c6ad37a4f250 'a/a'
184 |
185 | o 3: 844a7de3e617 'c'
186 | |
187 o | 2: 09c044d2cb43 'd'
188 | |
189 o | 1: fc055c3b4d33 'b'
190 |/
191 o 0: b173517d0057 'a'
192
193 $ echo foo > foo
194 $ hg ci -Aqm "added foo"
195 $ hg up '.^'
196 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
197 $ echo bar > bar
198 $ hg ci -Aqm "added bar"
199 $ hg rm a/a
200 $ echo a > a
201 $ hg ci -Aqm "added a back!"
202 $ hg tglog
203 @ 7: 855e9797387e 'added a back!'
204 |
205 o 6: d14530e5e3e6 'added bar'
206 |
207 | o 5: 9b94b9373deb 'added foo'
208 |/
209 o 4: c6ad37a4f250 'a/a'
210 |
211 | o 3: 844a7de3e617 'c'
212 | |
213 o | 2: 09c044d2cb43 'd'
214 | |
215 o | 1: fc055c3b4d33 'b'
216 |/
217 o 0: b173517d0057 'a'
218
219 $ hg rebase -r . -d 5
220 rebasing 7:855e9797387e "added a back!" (tip)
221 abort: error: file 'a' cannot be written because 'a/' is a folder in 9b94b9373deb (containing 1 entries: a/a)
222 [255]
223
182 $ cd ..
224 $ cd ..
183
225
184 Test dry-run rebasing
226 Test dry-run rebasing
185
227
186 $ hg init repo3
228 $ hg init repo3
187 $ cd repo3
229 $ cd repo3
188 $ echo a>a
230 $ echo a>a
189 $ hg ci -Aqma
231 $ hg ci -Aqma
190 $ echo b>b
232 $ echo b>b
191 $ hg ci -Aqmb
233 $ hg ci -Aqmb
192 $ echo c>c
234 $ echo c>c
193 $ hg ci -Aqmc
235 $ hg ci -Aqmc
194 $ echo d>d
236 $ echo d>d
195 $ hg ci -Aqmd
237 $ hg ci -Aqmd
196 $ echo e>e
238 $ echo e>e
197 $ hg ci -Aqme
239 $ hg ci -Aqme
198
240
199 $ hg up 1 -q
241 $ hg up 1 -q
200 $ echo f>f
242 $ echo f>f
201 $ hg ci -Amf
243 $ hg ci -Amf
202 adding f
244 adding f
203 created new head
245 created new head
204 $ echo g>g
246 $ echo g>g
205 $ hg ci -Aqmg
247 $ hg ci -Aqmg
206 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
248 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
207 @ 6:baf10c5166d4 test
249 @ 6:baf10c5166d4 test
208 | g
250 | g
209 |
251 |
210 o 5:6343ca3eff20 test
252 o 5:6343ca3eff20 test
211 | f
253 | f
212 |
254 |
213 | o 4:e860deea161a test
255 | o 4:e860deea161a test
214 | | e
256 | | e
215 | |
257 | |
216 | o 3:055a42cdd887 test
258 | o 3:055a42cdd887 test
217 | | d
259 | | d
218 | |
260 | |
219 | o 2:177f92b77385 test
261 | o 2:177f92b77385 test
220 |/ c
262 |/ c
221 |
263 |
222 o 1:d2ae7f538514 test
264 o 1:d2ae7f538514 test
223 | b
265 | b
224 |
266 |
225 o 0:cb9a9f314b8b test
267 o 0:cb9a9f314b8b test
226 a
268 a
227
269
228 Make sure it throws error while passing --continue or --abort with --dry-run
270 Make sure it throws error while passing --continue or --abort with --dry-run
229 $ hg rebase -s 2 -d 6 -n --continue
271 $ hg rebase -s 2 -d 6 -n --continue
230 abort: cannot specify both --dry-run and --continue
272 abort: cannot specify both --dry-run and --continue
231 [255]
273 [255]
232 $ hg rebase -s 2 -d 6 -n --abort
274 $ hg rebase -s 2 -d 6 -n --abort
233 abort: cannot specify both --dry-run and --abort
275 abort: cannot specify both --dry-run and --abort
234 [255]
276 [255]
235
277
236 Check dryrun gives correct results when there is no conflict in rebasing
278 Check dryrun gives correct results when there is no conflict in rebasing
237 $ hg rebase -s 2 -d 6 -n
279 $ hg rebase -s 2 -d 6 -n
238 starting dry-run rebase; repository will not be changed
280 starting dry-run rebase; repository will not be changed
239 rebasing 2:177f92b77385 "c"
281 rebasing 2:177f92b77385 "c"
240 rebasing 3:055a42cdd887 "d"
282 rebasing 3:055a42cdd887 "d"
241 rebasing 4:e860deea161a "e"
283 rebasing 4:e860deea161a "e"
242 dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase
284 dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase
243
285
244 $ hg diff
286 $ hg diff
245 $ hg status
287 $ hg status
246
288
247 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
289 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
248 @ 6:baf10c5166d4 test
290 @ 6:baf10c5166d4 test
249 | g
291 | g
250 |
292 |
251 o 5:6343ca3eff20 test
293 o 5:6343ca3eff20 test
252 | f
294 | f
253 |
295 |
254 | o 4:e860deea161a test
296 | o 4:e860deea161a test
255 | | e
297 | | e
256 | |
298 | |
257 | o 3:055a42cdd887 test
299 | o 3:055a42cdd887 test
258 | | d
300 | | d
259 | |
301 | |
260 | o 2:177f92b77385 test
302 | o 2:177f92b77385 test
261 |/ c
303 |/ c
262 |
304 |
263 o 1:d2ae7f538514 test
305 o 1:d2ae7f538514 test
264 | b
306 | b
265 |
307 |
266 o 0:cb9a9f314b8b test
308 o 0:cb9a9f314b8b test
267 a
309 a
268
310
269 Check dryrun working with --collapse when there is no conflict
311 Check dryrun working with --collapse when there is no conflict
270 $ hg rebase -s 2 -d 6 -n --collapse
312 $ hg rebase -s 2 -d 6 -n --collapse
271 starting dry-run rebase; repository will not be changed
313 starting dry-run rebase; repository will not be changed
272 rebasing 2:177f92b77385 "c"
314 rebasing 2:177f92b77385 "c"
273 rebasing 3:055a42cdd887 "d"
315 rebasing 3:055a42cdd887 "d"
274 rebasing 4:e860deea161a "e"
316 rebasing 4:e860deea161a "e"
275 dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase
317 dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase
276
318
277 Check dryrun gives correct results when there is conflict in rebasing
319 Check dryrun gives correct results when there is conflict in rebasing
278 Make a conflict:
320 Make a conflict:
279 $ hg up 6 -q
321 $ hg up 6 -q
280 $ echo conflict>e
322 $ echo conflict>e
281 $ hg ci -Aqm "conflict with e"
323 $ hg ci -Aqm "conflict with e"
282 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
324 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
283 @ 7:d2c195b28050 test
325 @ 7:d2c195b28050 test
284 | conflict with e
326 | conflict with e
285 |
327 |
286 o 6:baf10c5166d4 test
328 o 6:baf10c5166d4 test
287 | g
329 | g
288 |
330 |
289 o 5:6343ca3eff20 test
331 o 5:6343ca3eff20 test
290 | f
332 | f
291 |
333 |
292 | o 4:e860deea161a test
334 | o 4:e860deea161a test
293 | | e
335 | | e
294 | |
336 | |
295 | o 3:055a42cdd887 test
337 | o 3:055a42cdd887 test
296 | | d
338 | | d
297 | |
339 | |
298 | o 2:177f92b77385 test
340 | o 2:177f92b77385 test
299 |/ c
341 |/ c
300 |
342 |
301 o 1:d2ae7f538514 test
343 o 1:d2ae7f538514 test
302 | b
344 | b
303 |
345 |
304 o 0:cb9a9f314b8b test
346 o 0:cb9a9f314b8b test
305 a
347 a
306
348
307 $ hg rebase -s 2 -d 7 -n
349 $ hg rebase -s 2 -d 7 -n
308 starting dry-run rebase; repository will not be changed
350 starting dry-run rebase; repository will not be changed
309 rebasing 2:177f92b77385 "c"
351 rebasing 2:177f92b77385 "c"
310 rebasing 3:055a42cdd887 "d"
352 rebasing 3:055a42cdd887 "d"
311 rebasing 4:e860deea161a "e"
353 rebasing 4:e860deea161a "e"
312 merging e
354 merging e
313 transaction abort!
355 transaction abort!
314 rollback completed
356 rollback completed
315 hit a merge conflict
357 hit a merge conflict
316 [1]
358 [1]
317 $ hg diff
359 $ hg diff
318 $ hg status
360 $ hg status
319 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
361 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
320 @ 7:d2c195b28050 test
362 @ 7:d2c195b28050 test
321 | conflict with e
363 | conflict with e
322 |
364 |
323 o 6:baf10c5166d4 test
365 o 6:baf10c5166d4 test
324 | g
366 | g
325 |
367 |
326 o 5:6343ca3eff20 test
368 o 5:6343ca3eff20 test
327 | f
369 | f
328 |
370 |
329 | o 4:e860deea161a test
371 | o 4:e860deea161a test
330 | | e
372 | | e
331 | |
373 | |
332 | o 3:055a42cdd887 test
374 | o 3:055a42cdd887 test
333 | | d
375 | | d
334 | |
376 | |
335 | o 2:177f92b77385 test
377 | o 2:177f92b77385 test
336 |/ c
378 |/ c
337 |
379 |
338 o 1:d2ae7f538514 test
380 o 1:d2ae7f538514 test
339 | b
381 | b
340 |
382 |
341 o 0:cb9a9f314b8b test
383 o 0:cb9a9f314b8b test
342 a
384 a
343
385
344 Check dryrun working with --collapse when there is conflicts
386 Check dryrun working with --collapse when there is conflicts
345 $ hg rebase -s 2 -d 7 -n --collapse
387 $ hg rebase -s 2 -d 7 -n --collapse
346 starting dry-run rebase; repository will not be changed
388 starting dry-run rebase; repository will not be changed
347 rebasing 2:177f92b77385 "c"
389 rebasing 2:177f92b77385 "c"
348 rebasing 3:055a42cdd887 "d"
390 rebasing 3:055a42cdd887 "d"
349 rebasing 4:e860deea161a "e"
391 rebasing 4:e860deea161a "e"
350 merging e
392 merging e
351 hit a merge conflict
393 hit a merge conflict
352 [1]
394 [1]
353
395
354 In-memory rebase that fails due to merge conflicts
396 In-memory rebase that fails due to merge conflicts
355
397
356 $ hg rebase -s 2 -d 7
398 $ hg rebase -s 2 -d 7
357 rebasing 2:177f92b77385 "c"
399 rebasing 2:177f92b77385 "c"
358 rebasing 3:055a42cdd887 "d"
400 rebasing 3:055a42cdd887 "d"
359 rebasing 4:e860deea161a "e"
401 rebasing 4:e860deea161a "e"
360 merging e
402 merging e
361 transaction abort!
403 transaction abort!
362 rollback completed
404 rollback completed
363 hit merge conflicts; re-running rebase without in-memory merge
405 hit merge conflicts; re-running rebase without in-memory merge
364 rebase aborted
406 rebase aborted
365 rebasing 2:177f92b77385 "c"
407 rebasing 2:177f92b77385 "c"
366 rebasing 3:055a42cdd887 "d"
408 rebasing 3:055a42cdd887 "d"
367 rebasing 4:e860deea161a "e"
409 rebasing 4:e860deea161a "e"
368 merging e
410 merging e
369 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
411 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
370 unresolved conflicts (see hg resolve, then hg rebase --continue)
412 unresolved conflicts (see hg resolve, then hg rebase --continue)
371 [1]
413 [1]
372
414
373 ==========================
415 ==========================
374 Test for --confirm option|
416 Test for --confirm option|
375 ==========================
417 ==========================
376 $ cd ..
418 $ cd ..
377 $ hg clone repo3 repo4 -q
419 $ hg clone repo3 repo4 -q
378 $ cd repo4
420 $ cd repo4
379 $ hg strip 7 -q
421 $ hg strip 7 -q
380 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
422 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
381 @ 6:baf10c5166d4 test
423 @ 6:baf10c5166d4 test
382 | g
424 | g
383 |
425 |
384 o 5:6343ca3eff20 test
426 o 5:6343ca3eff20 test
385 | f
427 | f
386 |
428 |
387 | o 4:e860deea161a test
429 | o 4:e860deea161a test
388 | | e
430 | | e
389 | |
431 | |
390 | o 3:055a42cdd887 test
432 | o 3:055a42cdd887 test
391 | | d
433 | | d
392 | |
434 | |
393 | o 2:177f92b77385 test
435 | o 2:177f92b77385 test
394 |/ c
436 |/ c
395 |
437 |
396 o 1:d2ae7f538514 test
438 o 1:d2ae7f538514 test
397 | b
439 | b
398 |
440 |
399 o 0:cb9a9f314b8b test
441 o 0:cb9a9f314b8b test
400 a
442 a
401
443
402 Check it gives error when both --dryrun and --confirm is used:
444 Check it gives error when both --dryrun and --confirm is used:
403 $ hg rebase -s 2 -d . --confirm --dry-run
445 $ hg rebase -s 2 -d . --confirm --dry-run
404 abort: cannot specify both --confirm and --dry-run
446 abort: cannot specify both --confirm and --dry-run
405 [255]
447 [255]
406 $ hg rebase -s 2 -d . --confirm --abort
448 $ hg rebase -s 2 -d . --confirm --abort
407 abort: cannot specify both --confirm and --abort
449 abort: cannot specify both --confirm and --abort
408 [255]
450 [255]
409 $ hg rebase -s 2 -d . --confirm --continue
451 $ hg rebase -s 2 -d . --confirm --continue
410 abort: cannot specify both --confirm and --continue
452 abort: cannot specify both --confirm and --continue
411 [255]
453 [255]
412
454
413 Test --confirm option when there are no conflicts:
455 Test --confirm option when there are no conflicts:
414 $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF
456 $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF
415 > n
457 > n
416 > EOF
458 > EOF
417 starting in-memory rebase
459 starting in-memory rebase
418 rebasing 2:177f92b77385 "c"
460 rebasing 2:177f92b77385 "c"
419 rebasing 3:055a42cdd887 "d"
461 rebasing 3:055a42cdd887 "d"
420 rebasing 4:e860deea161a "e"
462 rebasing 4:e860deea161a "e"
421 rebase completed successfully
463 rebase completed successfully
422 apply changes (yn)? n
464 apply changes (yn)? n
423 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
465 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
424 @ 6:baf10c5166d4 test
466 @ 6:baf10c5166d4 test
425 | g
467 | g
426 |
468 |
427 o 5:6343ca3eff20 test
469 o 5:6343ca3eff20 test
428 | f
470 | f
429 |
471 |
430 | o 4:e860deea161a test
472 | o 4:e860deea161a test
431 | | e
473 | | e
432 | |
474 | |
433 | o 3:055a42cdd887 test
475 | o 3:055a42cdd887 test
434 | | d
476 | | d
435 | |
477 | |
436 | o 2:177f92b77385 test
478 | o 2:177f92b77385 test
437 |/ c
479 |/ c
438 |
480 |
439 o 1:d2ae7f538514 test
481 o 1:d2ae7f538514 test
440 | b
482 | b
441 |
483 |
442 o 0:cb9a9f314b8b test
484 o 0:cb9a9f314b8b test
443 a
485 a
444
486
445 $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF
487 $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF
446 > y
488 > y
447 > EOF
489 > EOF
448 starting in-memory rebase
490 starting in-memory rebase
449 rebasing 2:177f92b77385 "c"
491 rebasing 2:177f92b77385 "c"
450 rebasing 3:055a42cdd887 "d"
492 rebasing 3:055a42cdd887 "d"
451 rebasing 4:e860deea161a "e"
493 rebasing 4:e860deea161a "e"
452 rebase completed successfully
494 rebase completed successfully
453 apply changes (yn)? y
495 apply changes (yn)? y
454 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
496 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
455 o 9:9fd28f55f6dc test
497 o 9:9fd28f55f6dc test
456 | e
498 | e
457 |
499 |
458 o 8:12cbf031f469 test
500 o 8:12cbf031f469 test
459 | d
501 | d
460 |
502 |
461 o 7:c83b1da5b1ae test
503 o 7:c83b1da5b1ae test
462 | c
504 | c
463 |
505 |
464 @ 6:baf10c5166d4 test
506 @ 6:baf10c5166d4 test
465 | g
507 | g
466 |
508 |
467 o 5:6343ca3eff20 test
509 o 5:6343ca3eff20 test
468 | f
510 | f
469 |
511 |
470 | o 4:e860deea161a test
512 | o 4:e860deea161a test
471 | | e
513 | | e
472 | |
514 | |
473 | o 3:055a42cdd887 test
515 | o 3:055a42cdd887 test
474 | | d
516 | | d
475 | |
517 | |
476 | o 2:177f92b77385 test
518 | o 2:177f92b77385 test
477 |/ c
519 |/ c
478 |
520 |
479 o 1:d2ae7f538514 test
521 o 1:d2ae7f538514 test
480 | b
522 | b
481 |
523 |
482 o 0:cb9a9f314b8b test
524 o 0:cb9a9f314b8b test
483 a
525 a
484
526
485 Test --confirm option when there is a conflict
527 Test --confirm option when there is a conflict
486 $ hg up tip -q
528 $ hg up tip -q
487 $ echo ee>e
529 $ echo ee>e
488 $ hg ci --amend -m "conflict with e" -q
530 $ hg ci --amend -m "conflict with e" -q
489 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
531 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
490 @ 9:906d72f66a59 test
532 @ 9:906d72f66a59 test
491 | conflict with e
533 | conflict with e
492 |
534 |
493 o 8:12cbf031f469 test
535 o 8:12cbf031f469 test
494 | d
536 | d
495 |
537 |
496 o 7:c83b1da5b1ae test
538 o 7:c83b1da5b1ae test
497 | c
539 | c
498 |
540 |
499 o 6:baf10c5166d4 test
541 o 6:baf10c5166d4 test
500 | g
542 | g
501 |
543 |
502 o 5:6343ca3eff20 test
544 o 5:6343ca3eff20 test
503 | f
545 | f
504 |
546 |
505 | o 4:e860deea161a test
547 | o 4:e860deea161a test
506 | | e
548 | | e
507 | |
549 | |
508 | o 3:055a42cdd887 test
550 | o 3:055a42cdd887 test
509 | | d
551 | | d
510 | |
552 | |
511 | o 2:177f92b77385 test
553 | o 2:177f92b77385 test
512 |/ c
554 |/ c
513 |
555 |
514 o 1:d2ae7f538514 test
556 o 1:d2ae7f538514 test
515 | b
557 | b
516 |
558 |
517 o 0:cb9a9f314b8b test
559 o 0:cb9a9f314b8b test
518 a
560 a
519
561
520 $ hg rebase -s 4 -d . --keep --confirm
562 $ hg rebase -s 4 -d . --keep --confirm
521 starting in-memory rebase
563 starting in-memory rebase
522 rebasing 4:e860deea161a "e"
564 rebasing 4:e860deea161a "e"
523 merging e
565 merging e
524 hit a merge conflict
566 hit a merge conflict
525 [1]
567 [1]
526 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
568 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
527 @ 9:906d72f66a59 test
569 @ 9:906d72f66a59 test
528 | conflict with e
570 | conflict with e
529 |
571 |
530 o 8:12cbf031f469 test
572 o 8:12cbf031f469 test
531 | d
573 | d
532 |
574 |
533 o 7:c83b1da5b1ae test
575 o 7:c83b1da5b1ae test
534 | c
576 | c
535 |
577 |
536 o 6:baf10c5166d4 test
578 o 6:baf10c5166d4 test
537 | g
579 | g
538 |
580 |
539 o 5:6343ca3eff20 test
581 o 5:6343ca3eff20 test
540 | f
582 | f
541 |
583 |
542 | o 4:e860deea161a test
584 | o 4:e860deea161a test
543 | | e
585 | | e
544 | |
586 | |
545 | o 3:055a42cdd887 test
587 | o 3:055a42cdd887 test
546 | | d
588 | | d
547 | |
589 | |
548 | o 2:177f92b77385 test
590 | o 2:177f92b77385 test
549 |/ c
591 |/ c
550 |
592 |
551 o 1:d2ae7f538514 test
593 o 1:d2ae7f538514 test
552 | b
594 | b
553 |
595 |
554 o 0:cb9a9f314b8b test
596 o 0:cb9a9f314b8b test
555 a
597 a
556
598
557 #if execbit
599 #if execbit
558
600
559 Test a metadata-only in-memory merge
601 Test a metadata-only in-memory merge
560 $ cd $TESTTMP
602 $ cd $TESTTMP
561 $ hg init no_exception
603 $ hg init no_exception
562 $ cd no_exception
604 $ cd no_exception
563 # Produce the following graph:
605 # Produce the following graph:
564 # o 'add +x to foo.txt'
606 # o 'add +x to foo.txt'
565 # | o r1 (adds bar.txt, just for something to rebase to)
607 # | o r1 (adds bar.txt, just for something to rebase to)
566 # |/
608 # |/
567 # o r0 (adds foo.txt, no +x)
609 # o r0 (adds foo.txt, no +x)
568 $ echo hi > foo.txt
610 $ echo hi > foo.txt
569 $ hg ci -qAm r0
611 $ hg ci -qAm r0
570 $ echo hi > bar.txt
612 $ echo hi > bar.txt
571 $ hg ci -qAm r1
613 $ hg ci -qAm r1
572 $ hg co -qr ".^"
614 $ hg co -qr ".^"
573 $ chmod +x foo.txt
615 $ chmod +x foo.txt
574 $ hg ci -qAm 'add +x to foo.txt'
616 $ hg ci -qAm 'add +x to foo.txt'
575 issue5960: this was raising an AttributeError exception
617 issue5960: this was raising an AttributeError exception
576 $ hg rebase -r . -d 1
618 $ hg rebase -r . -d 1
577 rebasing 2:539b93e77479 "add +x to foo.txt" (tip)
619 rebasing 2:539b93e77479 "add +x to foo.txt" (tip)
578 saved backup bundle to $TESTTMP/no_exception/.hg/strip-backup/*.hg (glob)
620 saved backup bundle to $TESTTMP/no_exception/.hg/strip-backup/*.hg (glob)
579 $ hg diff -c tip
621 $ hg diff -c tip
580 diff --git a/foo.txt b/foo.txt
622 diff --git a/foo.txt b/foo.txt
581 old mode 100644
623 old mode 100644
582 new mode 100755
624 new mode 100755
583
625
584 #endif
626 #endif
General Comments 0
You need to be logged in to leave comments. Login now