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