Show More
@@ -1,539 +1,542 | |||||
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 | $ cd .. | |||
|
160 | ||||
159 | Test dry-run rebasing |
|
161 | Test dry-run rebasing | |
|
162 | ||||
160 | $ hg init repo3 |
|
163 | $ hg init repo3 | |
161 | $ cd repo3 |
|
164 | $ cd repo3 | |
162 | $ echo a>a |
|
165 | $ echo a>a | |
163 | $ hg ci -Aqma |
|
166 | $ hg ci -Aqma | |
164 | $ echo b>b |
|
167 | $ echo b>b | |
165 | $ hg ci -Aqmb |
|
168 | $ hg ci -Aqmb | |
166 | $ echo c>c |
|
169 | $ echo c>c | |
167 | $ hg ci -Aqmc |
|
170 | $ hg ci -Aqmc | |
168 | $ echo d>d |
|
171 | $ echo d>d | |
169 | $ hg ci -Aqmd |
|
172 | $ hg ci -Aqmd | |
170 | $ echo e>e |
|
173 | $ echo e>e | |
171 | $ hg ci -Aqme |
|
174 | $ hg ci -Aqme | |
172 |
|
175 | |||
173 | $ hg up 1 -q |
|
176 | $ hg up 1 -q | |
174 | $ echo f>f |
|
177 | $ echo f>f | |
175 | $ hg ci -Amf |
|
178 | $ hg ci -Amf | |
176 | adding f |
|
179 | adding f | |
177 | created new head |
|
180 | created new head | |
178 | $ echo g>g |
|
181 | $ echo g>g | |
179 | $ hg ci -Aqmg |
|
182 | $ hg ci -Aqmg | |
180 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" |
|
183 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" | |
181 | @ 6:baf10c5166d4 test |
|
184 | @ 6:baf10c5166d4 test | |
182 | | g |
|
185 | | g | |
183 | | |
|
186 | | | |
184 | o 5:6343ca3eff20 test |
|
187 | o 5:6343ca3eff20 test | |
185 | | f |
|
188 | | f | |
186 | | |
|
189 | | | |
187 | | o 4:e860deea161a test |
|
190 | | o 4:e860deea161a test | |
188 | | | e |
|
191 | | | e | |
189 | | | |
|
192 | | | | |
190 | | o 3:055a42cdd887 test |
|
193 | | o 3:055a42cdd887 test | |
191 | | | d |
|
194 | | | d | |
192 | | | |
|
195 | | | | |
193 | | o 2:177f92b77385 test |
|
196 | | o 2:177f92b77385 test | |
194 | |/ c |
|
197 | |/ c | |
195 | | |
|
198 | | | |
196 | o 1:d2ae7f538514 test |
|
199 | o 1:d2ae7f538514 test | |
197 | | b |
|
200 | | b | |
198 | | |
|
201 | | | |
199 | o 0:cb9a9f314b8b test |
|
202 | o 0:cb9a9f314b8b test | |
200 | a |
|
203 | a | |
201 |
|
204 | |||
202 | Make sure it throws error while passing --continue or --abort with --dry-run |
|
205 | Make sure it throws error while passing --continue or --abort with --dry-run | |
203 | $ hg rebase -s 2 -d 6 -n --continue |
|
206 | $ hg rebase -s 2 -d 6 -n --continue | |
204 | abort: cannot specify both --dry-run and --continue |
|
207 | abort: cannot specify both --dry-run and --continue | |
205 | [255] |
|
208 | [255] | |
206 | $ hg rebase -s 2 -d 6 -n --abort |
|
209 | $ hg rebase -s 2 -d 6 -n --abort | |
207 | abort: cannot specify both --dry-run and --abort |
|
210 | abort: cannot specify both --dry-run and --abort | |
208 | [255] |
|
211 | [255] | |
209 |
|
212 | |||
210 | Check dryrun gives correct results when there is no conflict in rebasing |
|
213 | Check dryrun gives correct results when there is no conflict in rebasing | |
211 | $ hg rebase -s 2 -d 6 -n |
|
214 | $ hg rebase -s 2 -d 6 -n | |
212 | starting dry-run rebase; repository will not be changed |
|
215 | starting dry-run rebase; repository will not be changed | |
213 | rebasing 2:177f92b77385 "c" |
|
216 | rebasing 2:177f92b77385 "c" | |
214 | rebasing 3:055a42cdd887 "d" |
|
217 | rebasing 3:055a42cdd887 "d" | |
215 | rebasing 4:e860deea161a "e" |
|
218 | rebasing 4:e860deea161a "e" | |
216 | dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase |
|
219 | dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase | |
217 |
|
220 | |||
218 | $ hg diff |
|
221 | $ hg diff | |
219 | $ hg status |
|
222 | $ hg status | |
220 |
|
223 | |||
221 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" |
|
224 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" | |
222 | @ 6:baf10c5166d4 test |
|
225 | @ 6:baf10c5166d4 test | |
223 | | g |
|
226 | | g | |
224 | | |
|
227 | | | |
225 | o 5:6343ca3eff20 test |
|
228 | o 5:6343ca3eff20 test | |
226 | | f |
|
229 | | f | |
227 | | |
|
230 | | | |
228 | | o 4:e860deea161a test |
|
231 | | o 4:e860deea161a test | |
229 | | | e |
|
232 | | | e | |
230 | | | |
|
233 | | | | |
231 | | o 3:055a42cdd887 test |
|
234 | | o 3:055a42cdd887 test | |
232 | | | d |
|
235 | | | d | |
233 | | | |
|
236 | | | | |
234 | | o 2:177f92b77385 test |
|
237 | | o 2:177f92b77385 test | |
235 | |/ c |
|
238 | |/ c | |
236 | | |
|
239 | | | |
237 | o 1:d2ae7f538514 test |
|
240 | o 1:d2ae7f538514 test | |
238 | | b |
|
241 | | b | |
239 | | |
|
242 | | | |
240 | o 0:cb9a9f314b8b test |
|
243 | o 0:cb9a9f314b8b test | |
241 | a |
|
244 | a | |
242 |
|
245 | |||
243 | Check dryrun working with --collapse when there is no conflict |
|
246 | Check dryrun working with --collapse when there is no conflict | |
244 | $ hg rebase -s 2 -d 6 -n --collapse |
|
247 | $ hg rebase -s 2 -d 6 -n --collapse | |
245 | starting dry-run rebase; repository will not be changed |
|
248 | starting dry-run rebase; repository will not be changed | |
246 | rebasing 2:177f92b77385 "c" |
|
249 | rebasing 2:177f92b77385 "c" | |
247 | rebasing 3:055a42cdd887 "d" |
|
250 | rebasing 3:055a42cdd887 "d" | |
248 | rebasing 4:e860deea161a "e" |
|
251 | rebasing 4:e860deea161a "e" | |
249 | dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase |
|
252 | dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase | |
250 |
|
253 | |||
251 | Check dryrun gives correct results when there is conflict in rebasing |
|
254 | Check dryrun gives correct results when there is conflict in rebasing | |
252 | Make a conflict: |
|
255 | Make a conflict: | |
253 | $ hg up 6 -q |
|
256 | $ hg up 6 -q | |
254 | $ echo conflict>e |
|
257 | $ echo conflict>e | |
255 | $ hg ci -Aqm "conflict with e" |
|
258 | $ hg ci -Aqm "conflict with e" | |
256 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" |
|
259 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" | |
257 | @ 7:d2c195b28050 test |
|
260 | @ 7:d2c195b28050 test | |
258 | | conflict with e |
|
261 | | conflict with e | |
259 | | |
|
262 | | | |
260 | o 6:baf10c5166d4 test |
|
263 | o 6:baf10c5166d4 test | |
261 | | g |
|
264 | | g | |
262 | | |
|
265 | | | |
263 | o 5:6343ca3eff20 test |
|
266 | o 5:6343ca3eff20 test | |
264 | | f |
|
267 | | f | |
265 | | |
|
268 | | | |
266 | | o 4:e860deea161a test |
|
269 | | o 4:e860deea161a test | |
267 | | | e |
|
270 | | | e | |
268 | | | |
|
271 | | | | |
269 | | o 3:055a42cdd887 test |
|
272 | | o 3:055a42cdd887 test | |
270 | | | d |
|
273 | | | d | |
271 | | | |
|
274 | | | | |
272 | | o 2:177f92b77385 test |
|
275 | | o 2:177f92b77385 test | |
273 | |/ c |
|
276 | |/ c | |
274 | | |
|
277 | | | |
275 | o 1:d2ae7f538514 test |
|
278 | o 1:d2ae7f538514 test | |
276 | | b |
|
279 | | b | |
277 | | |
|
280 | | | |
278 | o 0:cb9a9f314b8b test |
|
281 | o 0:cb9a9f314b8b test | |
279 | a |
|
282 | a | |
280 |
|
283 | |||
281 | $ hg rebase -s 2 -d 7 -n |
|
284 | $ hg rebase -s 2 -d 7 -n | |
282 | starting dry-run rebase; repository will not be changed |
|
285 | starting dry-run rebase; repository will not be changed | |
283 | rebasing 2:177f92b77385 "c" |
|
286 | rebasing 2:177f92b77385 "c" | |
284 | rebasing 3:055a42cdd887 "d" |
|
287 | rebasing 3:055a42cdd887 "d" | |
285 | rebasing 4:e860deea161a "e" |
|
288 | rebasing 4:e860deea161a "e" | |
286 | merging e |
|
289 | merging e | |
287 | transaction abort! |
|
290 | transaction abort! | |
288 | rollback completed |
|
291 | rollback completed | |
289 | hit a merge conflict |
|
292 | hit a merge conflict | |
290 | [1] |
|
293 | [1] | |
291 | $ hg diff |
|
294 | $ hg diff | |
292 | $ hg status |
|
295 | $ hg status | |
293 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" |
|
296 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" | |
294 | @ 7:d2c195b28050 test |
|
297 | @ 7:d2c195b28050 test | |
295 | | conflict with e |
|
298 | | conflict with e | |
296 | | |
|
299 | | | |
297 | o 6:baf10c5166d4 test |
|
300 | o 6:baf10c5166d4 test | |
298 | | g |
|
301 | | g | |
299 | | |
|
302 | | | |
300 | o 5:6343ca3eff20 test |
|
303 | o 5:6343ca3eff20 test | |
301 | | f |
|
304 | | f | |
302 | | |
|
305 | | | |
303 | | o 4:e860deea161a test |
|
306 | | o 4:e860deea161a test | |
304 | | | e |
|
307 | | | e | |
305 | | | |
|
308 | | | | |
306 | | o 3:055a42cdd887 test |
|
309 | | o 3:055a42cdd887 test | |
307 | | | d |
|
310 | | | d | |
308 | | | |
|
311 | | | | |
309 | | o 2:177f92b77385 test |
|
312 | | o 2:177f92b77385 test | |
310 | |/ c |
|
313 | |/ c | |
311 | | |
|
314 | | | |
312 | o 1:d2ae7f538514 test |
|
315 | o 1:d2ae7f538514 test | |
313 | | b |
|
316 | | b | |
314 | | |
|
317 | | | |
315 | o 0:cb9a9f314b8b test |
|
318 | o 0:cb9a9f314b8b test | |
316 | a |
|
319 | a | |
317 |
|
320 | |||
318 | Check dryrun working with --collapse when there is conflicts |
|
321 | Check dryrun working with --collapse when there is conflicts | |
319 | $ hg rebase -s 2 -d 7 -n --collapse |
|
322 | $ hg rebase -s 2 -d 7 -n --collapse | |
320 | starting dry-run rebase; repository will not be changed |
|
323 | starting dry-run rebase; repository will not be changed | |
321 | rebasing 2:177f92b77385 "c" |
|
324 | rebasing 2:177f92b77385 "c" | |
322 | rebasing 3:055a42cdd887 "d" |
|
325 | rebasing 3:055a42cdd887 "d" | |
323 | rebasing 4:e860deea161a "e" |
|
326 | rebasing 4:e860deea161a "e" | |
324 | merging e |
|
327 | merging e | |
325 | hit a merge conflict |
|
328 | hit a merge conflict | |
326 | [1] |
|
329 | [1] | |
327 |
|
330 | |||
328 | ========================== |
|
331 | ========================== | |
329 | Test for --confirm option| |
|
332 | Test for --confirm option| | |
330 | ========================== |
|
333 | ========================== | |
331 | $ cd .. |
|
334 | $ cd .. | |
332 | $ hg clone repo3 repo4 -q |
|
335 | $ hg clone repo3 repo4 -q | |
333 | $ cd repo4 |
|
336 | $ cd repo4 | |
334 | $ hg strip 7 -q |
|
337 | $ hg strip 7 -q | |
335 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" |
|
338 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" | |
336 | @ 6:baf10c5166d4 test |
|
339 | @ 6:baf10c5166d4 test | |
337 | | g |
|
340 | | g | |
338 | | |
|
341 | | | |
339 | o 5:6343ca3eff20 test |
|
342 | o 5:6343ca3eff20 test | |
340 | | f |
|
343 | | f | |
341 | | |
|
344 | | | |
342 | | o 4:e860deea161a test |
|
345 | | o 4:e860deea161a test | |
343 | | | e |
|
346 | | | e | |
344 | | | |
|
347 | | | | |
345 | | o 3:055a42cdd887 test |
|
348 | | o 3:055a42cdd887 test | |
346 | | | d |
|
349 | | | d | |
347 | | | |
|
350 | | | | |
348 | | o 2:177f92b77385 test |
|
351 | | o 2:177f92b77385 test | |
349 | |/ c |
|
352 | |/ c | |
350 | | |
|
353 | | | |
351 | o 1:d2ae7f538514 test |
|
354 | o 1:d2ae7f538514 test | |
352 | | b |
|
355 | | b | |
353 | | |
|
356 | | | |
354 | o 0:cb9a9f314b8b test |
|
357 | o 0:cb9a9f314b8b test | |
355 | a |
|
358 | a | |
356 |
|
359 | |||
357 | Check it gives error when both --dryrun and --confirm is used: |
|
360 | Check it gives error when both --dryrun and --confirm is used: | |
358 | $ hg rebase -s 2 -d . --confirm --dry-run |
|
361 | $ hg rebase -s 2 -d . --confirm --dry-run | |
359 | abort: cannot specify both --confirm and --dry-run |
|
362 | abort: cannot specify both --confirm and --dry-run | |
360 | [255] |
|
363 | [255] | |
361 | $ hg rebase -s 2 -d . --confirm --abort |
|
364 | $ hg rebase -s 2 -d . --confirm --abort | |
362 | abort: cannot specify both --confirm and --abort |
|
365 | abort: cannot specify both --confirm and --abort | |
363 | [255] |
|
366 | [255] | |
364 | $ hg rebase -s 2 -d . --confirm --continue |
|
367 | $ hg rebase -s 2 -d . --confirm --continue | |
365 | abort: cannot specify both --confirm and --continue |
|
368 | abort: cannot specify both --confirm and --continue | |
366 | [255] |
|
369 | [255] | |
367 |
|
370 | |||
368 | Test --confirm option when there are no conflicts: |
|
371 | Test --confirm option when there are no conflicts: | |
369 | $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF |
|
372 | $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF | |
370 | > n |
|
373 | > n | |
371 | > EOF |
|
374 | > EOF | |
372 | starting in-memory rebase |
|
375 | starting in-memory rebase | |
373 | rebasing 2:177f92b77385 "c" |
|
376 | rebasing 2:177f92b77385 "c" | |
374 | rebasing 3:055a42cdd887 "d" |
|
377 | rebasing 3:055a42cdd887 "d" | |
375 | rebasing 4:e860deea161a "e" |
|
378 | rebasing 4:e860deea161a "e" | |
376 | rebase completed successfully |
|
379 | rebase completed successfully | |
377 | apply changes (yn)? n |
|
380 | apply changes (yn)? n | |
378 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" |
|
381 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" | |
379 | @ 6:baf10c5166d4 test |
|
382 | @ 6:baf10c5166d4 test | |
380 | | g |
|
383 | | g | |
381 | | |
|
384 | | | |
382 | o 5:6343ca3eff20 test |
|
385 | o 5:6343ca3eff20 test | |
383 | | f |
|
386 | | f | |
384 | | |
|
387 | | | |
385 | | o 4:e860deea161a test |
|
388 | | o 4:e860deea161a test | |
386 | | | e |
|
389 | | | e | |
387 | | | |
|
390 | | | | |
388 | | o 3:055a42cdd887 test |
|
391 | | o 3:055a42cdd887 test | |
389 | | | d |
|
392 | | | d | |
390 | | | |
|
393 | | | | |
391 | | o 2:177f92b77385 test |
|
394 | | o 2:177f92b77385 test | |
392 | |/ c |
|
395 | |/ c | |
393 | | |
|
396 | | | |
394 | o 1:d2ae7f538514 test |
|
397 | o 1:d2ae7f538514 test | |
395 | | b |
|
398 | | b | |
396 | | |
|
399 | | | |
397 | o 0:cb9a9f314b8b test |
|
400 | o 0:cb9a9f314b8b test | |
398 | a |
|
401 | a | |
399 |
|
402 | |||
400 | $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF |
|
403 | $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF | |
401 | > y |
|
404 | > y | |
402 | > EOF |
|
405 | > EOF | |
403 | starting in-memory rebase |
|
406 | starting in-memory rebase | |
404 | rebasing 2:177f92b77385 "c" |
|
407 | rebasing 2:177f92b77385 "c" | |
405 | rebasing 3:055a42cdd887 "d" |
|
408 | rebasing 3:055a42cdd887 "d" | |
406 | rebasing 4:e860deea161a "e" |
|
409 | rebasing 4:e860deea161a "e" | |
407 | rebase completed successfully |
|
410 | rebase completed successfully | |
408 | apply changes (yn)? y |
|
411 | apply changes (yn)? y | |
409 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" |
|
412 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" | |
410 | o 9:9fd28f55f6dc test |
|
413 | o 9:9fd28f55f6dc test | |
411 | | e |
|
414 | | e | |
412 | | |
|
415 | | | |
413 | o 8:12cbf031f469 test |
|
416 | o 8:12cbf031f469 test | |
414 | | d |
|
417 | | d | |
415 | | |
|
418 | | | |
416 | o 7:c83b1da5b1ae test |
|
419 | o 7:c83b1da5b1ae test | |
417 | | c |
|
420 | | c | |
418 | | |
|
421 | | | |
419 | @ 6:baf10c5166d4 test |
|
422 | @ 6:baf10c5166d4 test | |
420 | | g |
|
423 | | g | |
421 | | |
|
424 | | | |
422 | o 5:6343ca3eff20 test |
|
425 | o 5:6343ca3eff20 test | |
423 | | f |
|
426 | | f | |
424 | | |
|
427 | | | |
425 | | o 4:e860deea161a test |
|
428 | | o 4:e860deea161a test | |
426 | | | e |
|
429 | | | e | |
427 | | | |
|
430 | | | | |
428 | | o 3:055a42cdd887 test |
|
431 | | o 3:055a42cdd887 test | |
429 | | | d |
|
432 | | | d | |
430 | | | |
|
433 | | | | |
431 | | o 2:177f92b77385 test |
|
434 | | o 2:177f92b77385 test | |
432 | |/ c |
|
435 | |/ c | |
433 | | |
|
436 | | | |
434 | o 1:d2ae7f538514 test |
|
437 | o 1:d2ae7f538514 test | |
435 | | b |
|
438 | | b | |
436 | | |
|
439 | | | |
437 | o 0:cb9a9f314b8b test |
|
440 | o 0:cb9a9f314b8b test | |
438 | a |
|
441 | a | |
439 |
|
442 | |||
440 | Test --confirm option when there is a conflict |
|
443 | Test --confirm option when there is a conflict | |
441 | $ hg up tip -q |
|
444 | $ hg up tip -q | |
442 | $ echo ee>e |
|
445 | $ echo ee>e | |
443 | $ hg ci --amend -m "conflict with e" -q |
|
446 | $ hg ci --amend -m "conflict with e" -q | |
444 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" |
|
447 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" | |
445 | @ 9:906d72f66a59 test |
|
448 | @ 9:906d72f66a59 test | |
446 | | conflict with e |
|
449 | | conflict with e | |
447 | | |
|
450 | | | |
448 | o 8:12cbf031f469 test |
|
451 | o 8:12cbf031f469 test | |
449 | | d |
|
452 | | d | |
450 | | |
|
453 | | | |
451 | o 7:c83b1da5b1ae test |
|
454 | o 7:c83b1da5b1ae test | |
452 | | c |
|
455 | | c | |
453 | | |
|
456 | | | |
454 | o 6:baf10c5166d4 test |
|
457 | o 6:baf10c5166d4 test | |
455 | | g |
|
458 | | g | |
456 | | |
|
459 | | | |
457 | o 5:6343ca3eff20 test |
|
460 | o 5:6343ca3eff20 test | |
458 | | f |
|
461 | | f | |
459 | | |
|
462 | | | |
460 | | o 4:e860deea161a test |
|
463 | | o 4:e860deea161a test | |
461 | | | e |
|
464 | | | e | |
462 | | | |
|
465 | | | | |
463 | | o 3:055a42cdd887 test |
|
466 | | o 3:055a42cdd887 test | |
464 | | | d |
|
467 | | | d | |
465 | | | |
|
468 | | | | |
466 | | o 2:177f92b77385 test |
|
469 | | o 2:177f92b77385 test | |
467 | |/ c |
|
470 | |/ c | |
468 | | |
|
471 | | | |
469 | o 1:d2ae7f538514 test |
|
472 | o 1:d2ae7f538514 test | |
470 | | b |
|
473 | | b | |
471 | | |
|
474 | | | |
472 | o 0:cb9a9f314b8b test |
|
475 | o 0:cb9a9f314b8b test | |
473 | a |
|
476 | a | |
474 |
|
477 | |||
475 | $ hg rebase -s 4 -d . --keep --confirm |
|
478 | $ hg rebase -s 4 -d . --keep --confirm | |
476 | starting in-memory rebase |
|
479 | starting in-memory rebase | |
477 | rebasing 4:e860deea161a "e" |
|
480 | rebasing 4:e860deea161a "e" | |
478 | merging e |
|
481 | merging e | |
479 | hit a merge conflict |
|
482 | hit a merge conflict | |
480 | [1] |
|
483 | [1] | |
481 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" |
|
484 | $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" | |
482 | @ 9:906d72f66a59 test |
|
485 | @ 9:906d72f66a59 test | |
483 | | conflict with e |
|
486 | | conflict with e | |
484 | | |
|
487 | | | |
485 | o 8:12cbf031f469 test |
|
488 | o 8:12cbf031f469 test | |
486 | | d |
|
489 | | d | |
487 | | |
|
490 | | | |
488 | o 7:c83b1da5b1ae test |
|
491 | o 7:c83b1da5b1ae test | |
489 | | c |
|
492 | | c | |
490 | | |
|
493 | | | |
491 | o 6:baf10c5166d4 test |
|
494 | o 6:baf10c5166d4 test | |
492 | | g |
|
495 | | g | |
493 | | |
|
496 | | | |
494 | o 5:6343ca3eff20 test |
|
497 | o 5:6343ca3eff20 test | |
495 | | f |
|
498 | | f | |
496 | | |
|
499 | | | |
497 | | o 4:e860deea161a test |
|
500 | | o 4:e860deea161a test | |
498 | | | e |
|
501 | | | e | |
499 | | | |
|
502 | | | | |
500 | | o 3:055a42cdd887 test |
|
503 | | o 3:055a42cdd887 test | |
501 | | | d |
|
504 | | | d | |
502 | | | |
|
505 | | | | |
503 | | o 2:177f92b77385 test |
|
506 | | o 2:177f92b77385 test | |
504 | |/ c |
|
507 | |/ c | |
505 | | |
|
508 | | | |
506 | o 1:d2ae7f538514 test |
|
509 | o 1:d2ae7f538514 test | |
507 | | b |
|
510 | | b | |
508 | | |
|
511 | | | |
509 | o 0:cb9a9f314b8b test |
|
512 | o 0:cb9a9f314b8b test | |
510 | a |
|
513 | a | |
511 |
|
514 | |||
512 | #if execbit |
|
515 | #if execbit | |
513 |
|
516 | |||
514 | Test a metadata-only in-memory merge |
|
517 | Test a metadata-only in-memory merge | |
515 | $ cd $TESTTMP |
|
518 | $ cd $TESTTMP | |
516 | $ hg init no_exception |
|
519 | $ hg init no_exception | |
517 | $ cd no_exception |
|
520 | $ cd no_exception | |
518 | # Produce the following graph: |
|
521 | # Produce the following graph: | |
519 | # o 'add +x to foo.txt' |
|
522 | # o 'add +x to foo.txt' | |
520 | # | o r1 (adds bar.txt, just for something to rebase to) |
|
523 | # | o r1 (adds bar.txt, just for something to rebase to) | |
521 | # |/ |
|
524 | # |/ | |
522 | # o r0 (adds foo.txt, no +x) |
|
525 | # o r0 (adds foo.txt, no +x) | |
523 | $ echo hi > foo.txt |
|
526 | $ echo hi > foo.txt | |
524 | $ hg ci -qAm r0 |
|
527 | $ hg ci -qAm r0 | |
525 | $ echo hi > bar.txt |
|
528 | $ echo hi > bar.txt | |
526 | $ hg ci -qAm r1 |
|
529 | $ hg ci -qAm r1 | |
527 | $ hg co -qr ".^" |
|
530 | $ hg co -qr ".^" | |
528 | $ chmod +x foo.txt |
|
531 | $ chmod +x foo.txt | |
529 | $ hg ci -qAm 'add +x to foo.txt' |
|
532 | $ hg ci -qAm 'add +x to foo.txt' | |
530 | issue5960: this was raising an AttributeError exception |
|
533 | issue5960: this was raising an AttributeError exception | |
531 | $ hg rebase -r . -d 1 |
|
534 | $ hg rebase -r . -d 1 | |
532 | rebasing 2:539b93e77479 "add +x to foo.txt" (tip) |
|
535 | rebasing 2:539b93e77479 "add +x to foo.txt" (tip) | |
533 | saved backup bundle to $TESTTMP/no_exception/.hg/strip-backup/*.hg (glob) |
|
536 | saved backup bundle to $TESTTMP/no_exception/.hg/strip-backup/*.hg (glob) | |
534 | $ hg diff -c tip |
|
537 | $ hg diff -c tip | |
535 | diff --git a/foo.txt b/foo.txt |
|
538 | diff --git a/foo.txt b/foo.txt | |
536 | old mode 100644 |
|
539 | old mode 100644 | |
537 | new mode 100755 |
|
540 | new mode 100755 | |
538 |
|
541 | |||
539 | #endif |
|
542 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now