Show More
@@ -1,521 +1,528 | |||||
1 | $ cat >> $HGRCPATH <<EOF |
|
1 | $ cat >> $HGRCPATH <<EOF | |
2 | > [extensions] |
|
2 | > [extensions] | |
3 | > rebase= |
|
3 | > rebase= | |
4 | > |
|
4 | > | |
5 | > [phases] |
|
5 | > [phases] | |
6 | > publish=False |
|
6 | > publish=False | |
7 | > |
|
7 | > | |
8 | > [alias] |
|
8 | > [alias] | |
9 | > tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n" |
|
9 | > tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n" | |
10 | > EOF |
|
10 | > EOF | |
11 |
|
11 | |||
12 |
|
12 | |||
13 | $ hg init a |
|
13 | $ hg init a | |
14 | $ cd a |
|
14 | $ cd a | |
15 | $ hg unbundle "$TESTDIR/bundles/rebase.hg" |
|
15 | $ hg unbundle "$TESTDIR/bundles/rebase.hg" | |
16 | adding changesets |
|
16 | adding changesets | |
17 | adding manifests |
|
17 | adding manifests | |
18 | adding file changes |
|
18 | adding file changes | |
19 | added 8 changesets with 7 changes to 7 files (+2 heads) |
|
19 | added 8 changesets with 7 changes to 7 files (+2 heads) | |
20 | new changesets cd010b8cd998:02de42196ebe (8 drafts) |
|
20 | new changesets cd010b8cd998:02de42196ebe (8 drafts) | |
21 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
21 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
22 | $ hg up tip |
|
22 | $ hg up tip | |
23 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
23 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
24 |
|
24 | |||
25 | $ echo I > I |
|
25 | $ echo I > I | |
26 | $ hg ci -AmI |
|
26 | $ hg ci -AmI | |
27 | adding I |
|
27 | adding I | |
28 |
|
28 | |||
29 | $ hg tglog |
|
29 | $ hg tglog | |
30 | @ 8: e7ec4e813ba6 'I' |
|
30 | @ 8: e7ec4e813ba6 'I' | |
31 | | |
|
31 | | | |
32 | o 7: 02de42196ebe 'H' |
|
32 | o 7: 02de42196ebe 'H' | |
33 | | |
|
33 | | | |
34 | | o 6: eea13746799a 'G' |
|
34 | | o 6: eea13746799a 'G' | |
35 | |/| |
|
35 | |/| | |
36 | o | 5: 24b6387c8c8c 'F' |
|
36 | o | 5: 24b6387c8c8c 'F' | |
37 | | | |
|
37 | | | | |
38 | | o 4: 9520eea781bc 'E' |
|
38 | | o 4: 9520eea781bc 'E' | |
39 | |/ |
|
39 | |/ | |
40 | | o 3: 32af7686d403 'D' |
|
40 | | o 3: 32af7686d403 'D' | |
41 | | | |
|
41 | | | | |
42 | | o 2: 5fddd98957c8 'C' |
|
42 | | o 2: 5fddd98957c8 'C' | |
43 | | | |
|
43 | | | | |
44 | | o 1: 42ccdea3bb16 'B' |
|
44 | | o 1: 42ccdea3bb16 'B' | |
45 | |/ |
|
45 | |/ | |
46 | o 0: cd010b8cd998 'A' |
|
46 | o 0: cd010b8cd998 'A' | |
47 |
|
47 | |||
48 | $ cd .. |
|
48 | $ cd .. | |
49 |
|
49 | |||
50 | Version with only two heads (to allow default destination to work) |
|
50 | Version with only two heads (to allow default destination to work) | |
51 |
|
51 | |||
52 | $ hg clone -q -u . a a2heads -r 3 -r 8 |
|
52 | $ hg clone -q -u . a a2heads -r 3 -r 8 | |
53 |
|
53 | |||
54 | These fail: |
|
54 | These fail: | |
55 |
|
55 | |||
56 | $ hg clone -q -u . a a0 |
|
56 | $ hg clone -q -u . a a0 | |
57 | $ cd a0 |
|
57 | $ cd a0 | |
58 |
|
58 | |||
59 | $ hg rebase -s 8 -d 7 |
|
59 | $ hg rebase -s 8 -d 7 | |
60 | nothing to rebase |
|
60 | nothing to rebase | |
61 | [1] |
|
61 | [1] | |
62 |
|
62 | |||
63 | $ hg rebase --continue --abort |
|
63 | $ hg rebase --continue --abort | |
64 | abort: cannot specify both --abort and --continue |
|
64 | abort: cannot specify both --abort and --continue | |
65 | [255] |
|
65 | [255] | |
66 |
|
66 | |||
67 | $ hg rebase --continue --collapse |
|
67 | $ hg rebase --continue --collapse | |
68 | abort: cannot use collapse with continue or abort |
|
68 | abort: cannot use collapse with continue or abort | |
69 | [255] |
|
69 | [255] | |
70 |
|
70 | |||
71 | $ hg rebase --continue --dest 4 |
|
71 | $ hg rebase --continue --dest 4 | |
72 | abort: cannot specify both --continue and --dest |
|
72 | abort: cannot specify both --continue and --dest | |
73 | [255] |
|
73 | [255] | |
74 |
|
74 | |||
75 | $ hg rebase --base 5 --source 4 |
|
75 | $ hg rebase --base 5 --source 4 | |
76 | abort: cannot specify both --source and --base |
|
76 | abort: cannot specify both --source and --base | |
77 | [255] |
|
77 | [255] | |
78 |
|
78 | |||
79 | $ hg rebase --rev 5 --source 4 |
|
79 | $ hg rebase --rev 5 --source 4 | |
80 | abort: cannot specify both --rev and --source |
|
80 | abort: cannot specify both --rev and --source | |
81 | [255] |
|
81 | [255] | |
82 | $ hg rebase --base 5 --rev 4 |
|
82 | $ hg rebase --base 5 --rev 4 | |
83 | abort: cannot specify both --rev and --base |
|
83 | abort: cannot specify both --rev and --base | |
84 | [255] |
|
84 | [255] | |
85 |
|
85 | |||
86 | $ hg rebase --base 6 |
|
86 | $ hg rebase --base 6 | |
87 | abort: branch 'default' has 3 heads - please rebase to an explicit rev |
|
87 | abort: branch 'default' has 3 heads - please rebase to an explicit rev | |
88 | (run 'hg heads .' to see heads, specify destination with -d) |
|
88 | (run 'hg heads .' to see heads, specify destination with -d) | |
89 | [255] |
|
89 | [255] | |
90 |
|
90 | |||
91 | $ hg rebase --rev '1 & !1' --dest 8 |
|
91 | $ hg rebase --rev '1 & !1' --dest 8 | |
92 | empty "rev" revision set - nothing to rebase |
|
92 | empty "rev" revision set - nothing to rebase | |
93 | [1] |
|
93 | [1] | |
94 |
|
94 | |||
|
95 | $ hg rebase --rev 'wdir()' --dest 6 | |||
|
96 | abort: working directory revision cannot be specified | |||
|
97 | [255] | |||
|
98 | ||||
|
99 | $ hg rebase --source 'wdir()' --dest 6 2>&1 | grep assert | |||
|
100 | assert rebaseset | |||
|
101 | ||||
95 | $ hg rebase --source '1 & !1' --dest 8 |
|
102 | $ hg rebase --source '1 & !1' --dest 8 | |
96 | empty "source" revision set - nothing to rebase |
|
103 | empty "source" revision set - nothing to rebase | |
97 | [1] |
|
104 | [1] | |
98 |
|
105 | |||
99 | $ hg rebase --base '1 & !1' --dest 8 |
|
106 | $ hg rebase --base '1 & !1' --dest 8 | |
100 | empty "base" revision set - can't compute rebase set |
|
107 | empty "base" revision set - can't compute rebase set | |
101 | [1] |
|
108 | [1] | |
102 |
|
109 | |||
103 | $ hg rebase --dest 8 |
|
110 | $ hg rebase --dest 8 | |
104 | nothing to rebase - working directory parent is also destination |
|
111 | nothing to rebase - working directory parent is also destination | |
105 | [1] |
|
112 | [1] | |
106 |
|
113 | |||
107 | $ hg rebase -b . --dest 8 |
|
114 | $ hg rebase -b . --dest 8 | |
108 | nothing to rebase - e7ec4e813ba6 is both "base" and destination |
|
115 | nothing to rebase - e7ec4e813ba6 is both "base" and destination | |
109 | [1] |
|
116 | [1] | |
110 |
|
117 | |||
111 | $ hg up -q 7 |
|
118 | $ hg up -q 7 | |
112 |
|
119 | |||
113 | $ hg rebase --dest 8 --traceback |
|
120 | $ hg rebase --dest 8 --traceback | |
114 | nothing to rebase - working directory parent is already an ancestor of destination e7ec4e813ba6 |
|
121 | nothing to rebase - working directory parent is already an ancestor of destination e7ec4e813ba6 | |
115 | [1] |
|
122 | [1] | |
116 |
|
123 | |||
117 | $ hg rebase --dest 8 -b. |
|
124 | $ hg rebase --dest 8 -b. | |
118 | nothing to rebase - "base" 02de42196ebe is already an ancestor of destination e7ec4e813ba6 |
|
125 | nothing to rebase - "base" 02de42196ebe is already an ancestor of destination e7ec4e813ba6 | |
119 | [1] |
|
126 | [1] | |
120 |
|
127 | |||
121 | $ hg rebase --dest '1 & !1' |
|
128 | $ hg rebase --dest '1 & !1' | |
122 | abort: empty revision set |
|
129 | abort: empty revision set | |
123 | [255] |
|
130 | [255] | |
124 |
|
131 | |||
125 | These work: |
|
132 | These work: | |
126 |
|
133 | |||
127 | Rebase with no arguments (from 3 onto 8): |
|
134 | Rebase with no arguments (from 3 onto 8): | |
128 |
|
135 | |||
129 | $ cd .. |
|
136 | $ cd .. | |
130 | $ hg clone -q -u . a2heads a1 |
|
137 | $ hg clone -q -u . a2heads a1 | |
131 | $ cd a1 |
|
138 | $ cd a1 | |
132 | $ hg up -q -C 3 |
|
139 | $ hg up -q -C 3 | |
133 |
|
140 | |||
134 | $ hg rebase |
|
141 | $ hg rebase | |
135 | rebasing 1:42ccdea3bb16 "B" |
|
142 | rebasing 1:42ccdea3bb16 "B" | |
136 | rebasing 2:5fddd98957c8 "C" |
|
143 | rebasing 2:5fddd98957c8 "C" | |
137 | rebasing 3:32af7686d403 "D" |
|
144 | rebasing 3:32af7686d403 "D" | |
138 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg |
|
145 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg | |
139 |
|
146 | |||
140 | $ hg tglog |
|
147 | $ hg tglog | |
141 | @ 6: ed65089c18f8 'D' |
|
148 | @ 6: ed65089c18f8 'D' | |
142 | | |
|
149 | | | |
143 | o 5: 7621bf1a2f17 'C' |
|
150 | o 5: 7621bf1a2f17 'C' | |
144 | | |
|
151 | | | |
145 | o 4: 9430a62369c6 'B' |
|
152 | o 4: 9430a62369c6 'B' | |
146 | | |
|
153 | | | |
147 | o 3: e7ec4e813ba6 'I' |
|
154 | o 3: e7ec4e813ba6 'I' | |
148 | | |
|
155 | | | |
149 | o 2: 02de42196ebe 'H' |
|
156 | o 2: 02de42196ebe 'H' | |
150 | | |
|
157 | | | |
151 | o 1: 24b6387c8c8c 'F' |
|
158 | o 1: 24b6387c8c8c 'F' | |
152 | | |
|
159 | | | |
153 | o 0: cd010b8cd998 'A' |
|
160 | o 0: cd010b8cd998 'A' | |
154 |
|
161 | |||
155 | Try to rollback after a rebase (fail): |
|
162 | Try to rollback after a rebase (fail): | |
156 |
|
163 | |||
157 | $ hg rollback |
|
164 | $ hg rollback | |
158 | no rollback information available |
|
165 | no rollback information available | |
159 | [1] |
|
166 | [1] | |
160 |
|
167 | |||
161 | $ cd .. |
|
168 | $ cd .. | |
162 |
|
169 | |||
163 | Rebase with base == '.' => same as no arguments (from 3 onto 8): |
|
170 | Rebase with base == '.' => same as no arguments (from 3 onto 8): | |
164 |
|
171 | |||
165 | $ hg clone -q -u 3 a2heads a2 |
|
172 | $ hg clone -q -u 3 a2heads a2 | |
166 | $ cd a2 |
|
173 | $ cd a2 | |
167 |
|
174 | |||
168 | $ hg rebase --base . |
|
175 | $ hg rebase --base . | |
169 | rebasing 1:42ccdea3bb16 "B" |
|
176 | rebasing 1:42ccdea3bb16 "B" | |
170 | rebasing 2:5fddd98957c8 "C" |
|
177 | rebasing 2:5fddd98957c8 "C" | |
171 | rebasing 3:32af7686d403 "D" |
|
178 | rebasing 3:32af7686d403 "D" | |
172 | saved backup bundle to $TESTTMP/a2/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg |
|
179 | saved backup bundle to $TESTTMP/a2/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg | |
173 |
|
180 | |||
174 | $ hg tglog |
|
181 | $ hg tglog | |
175 | @ 6: ed65089c18f8 'D' |
|
182 | @ 6: ed65089c18f8 'D' | |
176 | | |
|
183 | | | |
177 | o 5: 7621bf1a2f17 'C' |
|
184 | o 5: 7621bf1a2f17 'C' | |
178 | | |
|
185 | | | |
179 | o 4: 9430a62369c6 'B' |
|
186 | o 4: 9430a62369c6 'B' | |
180 | | |
|
187 | | | |
181 | o 3: e7ec4e813ba6 'I' |
|
188 | o 3: e7ec4e813ba6 'I' | |
182 | | |
|
189 | | | |
183 | o 2: 02de42196ebe 'H' |
|
190 | o 2: 02de42196ebe 'H' | |
184 | | |
|
191 | | | |
185 | o 1: 24b6387c8c8c 'F' |
|
192 | o 1: 24b6387c8c8c 'F' | |
186 | | |
|
193 | | | |
187 | o 0: cd010b8cd998 'A' |
|
194 | o 0: cd010b8cd998 'A' | |
188 |
|
195 | |||
189 | $ cd .. |
|
196 | $ cd .. | |
190 |
|
197 | |||
191 |
|
198 | |||
192 | Rebase with dest == branch(.) => same as no arguments (from 3 onto 8): |
|
199 | Rebase with dest == branch(.) => same as no arguments (from 3 onto 8): | |
193 |
|
200 | |||
194 | $ hg clone -q -u 3 a a3 |
|
201 | $ hg clone -q -u 3 a a3 | |
195 | $ cd a3 |
|
202 | $ cd a3 | |
196 |
|
203 | |||
197 | $ hg rebase --dest 'branch(.)' |
|
204 | $ hg rebase --dest 'branch(.)' | |
198 | rebasing 1:42ccdea3bb16 "B" |
|
205 | rebasing 1:42ccdea3bb16 "B" | |
199 | rebasing 2:5fddd98957c8 "C" |
|
206 | rebasing 2:5fddd98957c8 "C" | |
200 | rebasing 3:32af7686d403 "D" |
|
207 | rebasing 3:32af7686d403 "D" | |
201 | saved backup bundle to $TESTTMP/a3/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg |
|
208 | saved backup bundle to $TESTTMP/a3/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg | |
202 |
|
209 | |||
203 | $ hg tglog |
|
210 | $ hg tglog | |
204 | @ 8: ed65089c18f8 'D' |
|
211 | @ 8: ed65089c18f8 'D' | |
205 | | |
|
212 | | | |
206 | o 7: 7621bf1a2f17 'C' |
|
213 | o 7: 7621bf1a2f17 'C' | |
207 | | |
|
214 | | | |
208 | o 6: 9430a62369c6 'B' |
|
215 | o 6: 9430a62369c6 'B' | |
209 | | |
|
216 | | | |
210 | o 5: e7ec4e813ba6 'I' |
|
217 | o 5: e7ec4e813ba6 'I' | |
211 | | |
|
218 | | | |
212 | o 4: 02de42196ebe 'H' |
|
219 | o 4: 02de42196ebe 'H' | |
213 | | |
|
220 | | | |
214 | | o 3: eea13746799a 'G' |
|
221 | | o 3: eea13746799a 'G' | |
215 | |/| |
|
222 | |/| | |
216 | o | 2: 24b6387c8c8c 'F' |
|
223 | o | 2: 24b6387c8c8c 'F' | |
217 | | | |
|
224 | | | | |
218 | | o 1: 9520eea781bc 'E' |
|
225 | | o 1: 9520eea781bc 'E' | |
219 | |/ |
|
226 | |/ | |
220 | o 0: cd010b8cd998 'A' |
|
227 | o 0: cd010b8cd998 'A' | |
221 |
|
228 | |||
222 | $ cd .. |
|
229 | $ cd .. | |
223 |
|
230 | |||
224 |
|
231 | |||
225 | Specify only source (from 2 onto 8): |
|
232 | Specify only source (from 2 onto 8): | |
226 |
|
233 | |||
227 | $ hg clone -q -u . a2heads a4 |
|
234 | $ hg clone -q -u . a2heads a4 | |
228 | $ cd a4 |
|
235 | $ cd a4 | |
229 |
|
236 | |||
230 | $ hg rebase --source 'desc("C")' |
|
237 | $ hg rebase --source 'desc("C")' | |
231 | rebasing 2:5fddd98957c8 "C" |
|
238 | rebasing 2:5fddd98957c8 "C" | |
232 | rebasing 3:32af7686d403 "D" |
|
239 | rebasing 3:32af7686d403 "D" | |
233 | saved backup bundle to $TESTTMP/a4/.hg/strip-backup/5fddd98957c8-f9244fa1-rebase.hg |
|
240 | saved backup bundle to $TESTTMP/a4/.hg/strip-backup/5fddd98957c8-f9244fa1-rebase.hg | |
234 |
|
241 | |||
235 | $ hg tglog |
|
242 | $ hg tglog | |
236 | o 6: 7726e9fd58f7 'D' |
|
243 | o 6: 7726e9fd58f7 'D' | |
237 | | |
|
244 | | | |
238 | o 5: 72c8333623d0 'C' |
|
245 | o 5: 72c8333623d0 'C' | |
239 | | |
|
246 | | | |
240 | @ 4: e7ec4e813ba6 'I' |
|
247 | @ 4: e7ec4e813ba6 'I' | |
241 | | |
|
248 | | | |
242 | o 3: 02de42196ebe 'H' |
|
249 | o 3: 02de42196ebe 'H' | |
243 | | |
|
250 | | | |
244 | o 2: 24b6387c8c8c 'F' |
|
251 | o 2: 24b6387c8c8c 'F' | |
245 | | |
|
252 | | | |
246 | | o 1: 42ccdea3bb16 'B' |
|
253 | | o 1: 42ccdea3bb16 'B' | |
247 | |/ |
|
254 | |/ | |
248 | o 0: cd010b8cd998 'A' |
|
255 | o 0: cd010b8cd998 'A' | |
249 |
|
256 | |||
250 | $ cd .. |
|
257 | $ cd .. | |
251 |
|
258 | |||
252 |
|
259 | |||
253 | Specify only dest (from 3 onto 6): |
|
260 | Specify only dest (from 3 onto 6): | |
254 |
|
261 | |||
255 | $ hg clone -q -u 3 a a5 |
|
262 | $ hg clone -q -u 3 a a5 | |
256 | $ cd a5 |
|
263 | $ cd a5 | |
257 |
|
264 | |||
258 | $ hg rebase --dest 6 |
|
265 | $ hg rebase --dest 6 | |
259 | rebasing 1:42ccdea3bb16 "B" |
|
266 | rebasing 1:42ccdea3bb16 "B" | |
260 | rebasing 2:5fddd98957c8 "C" |
|
267 | rebasing 2:5fddd98957c8 "C" | |
261 | rebasing 3:32af7686d403 "D" |
|
268 | rebasing 3:32af7686d403 "D" | |
262 | saved backup bundle to $TESTTMP/a5/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg |
|
269 | saved backup bundle to $TESTTMP/a5/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg | |
263 |
|
270 | |||
264 | $ hg tglog |
|
271 | $ hg tglog | |
265 | @ 8: 8eeb3c33ad33 'D' |
|
272 | @ 8: 8eeb3c33ad33 'D' | |
266 | | |
|
273 | | | |
267 | o 7: 2327fea05063 'C' |
|
274 | o 7: 2327fea05063 'C' | |
268 | | |
|
275 | | | |
269 | o 6: e4e5be0395b2 'B' |
|
276 | o 6: e4e5be0395b2 'B' | |
270 | | |
|
277 | | | |
271 | | o 5: e7ec4e813ba6 'I' |
|
278 | | o 5: e7ec4e813ba6 'I' | |
272 | | | |
|
279 | | | | |
273 | | o 4: 02de42196ebe 'H' |
|
280 | | o 4: 02de42196ebe 'H' | |
274 | | | |
|
281 | | | | |
275 | o | 3: eea13746799a 'G' |
|
282 | o | 3: eea13746799a 'G' | |
276 | |\| |
|
283 | |\| | |
277 | | o 2: 24b6387c8c8c 'F' |
|
284 | | o 2: 24b6387c8c8c 'F' | |
278 | | | |
|
285 | | | | |
279 | o | 1: 9520eea781bc 'E' |
|
286 | o | 1: 9520eea781bc 'E' | |
280 | |/ |
|
287 | |/ | |
281 | o 0: cd010b8cd998 'A' |
|
288 | o 0: cd010b8cd998 'A' | |
282 |
|
289 | |||
283 | $ cd .. |
|
290 | $ cd .. | |
284 |
|
291 | |||
285 |
|
292 | |||
286 | Specify only base (from 1 onto 8): |
|
293 | Specify only base (from 1 onto 8): | |
287 |
|
294 | |||
288 | $ hg clone -q -u . a2heads a6 |
|
295 | $ hg clone -q -u . a2heads a6 | |
289 | $ cd a6 |
|
296 | $ cd a6 | |
290 |
|
297 | |||
291 | $ hg rebase --base 'desc("D")' |
|
298 | $ hg rebase --base 'desc("D")' | |
292 | rebasing 1:42ccdea3bb16 "B" |
|
299 | rebasing 1:42ccdea3bb16 "B" | |
293 | rebasing 2:5fddd98957c8 "C" |
|
300 | rebasing 2:5fddd98957c8 "C" | |
294 | rebasing 3:32af7686d403 "D" |
|
301 | rebasing 3:32af7686d403 "D" | |
295 | saved backup bundle to $TESTTMP/a6/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg |
|
302 | saved backup bundle to $TESTTMP/a6/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg | |
296 |
|
303 | |||
297 | $ hg tglog |
|
304 | $ hg tglog | |
298 | o 6: ed65089c18f8 'D' |
|
305 | o 6: ed65089c18f8 'D' | |
299 | | |
|
306 | | | |
300 | o 5: 7621bf1a2f17 'C' |
|
307 | o 5: 7621bf1a2f17 'C' | |
301 | | |
|
308 | | | |
302 | o 4: 9430a62369c6 'B' |
|
309 | o 4: 9430a62369c6 'B' | |
303 | | |
|
310 | | | |
304 | @ 3: e7ec4e813ba6 'I' |
|
311 | @ 3: e7ec4e813ba6 'I' | |
305 | | |
|
312 | | | |
306 | o 2: 02de42196ebe 'H' |
|
313 | o 2: 02de42196ebe 'H' | |
307 | | |
|
314 | | | |
308 | o 1: 24b6387c8c8c 'F' |
|
315 | o 1: 24b6387c8c8c 'F' | |
309 | | |
|
316 | | | |
310 | o 0: cd010b8cd998 'A' |
|
317 | o 0: cd010b8cd998 'A' | |
311 |
|
318 | |||
312 | $ cd .. |
|
319 | $ cd .. | |
313 |
|
320 | |||
314 |
|
321 | |||
315 | Specify source and dest (from 2 onto 7): |
|
322 | Specify source and dest (from 2 onto 7): | |
316 |
|
323 | |||
317 | $ hg clone -q -u . a a7 |
|
324 | $ hg clone -q -u . a a7 | |
318 | $ cd a7 |
|
325 | $ cd a7 | |
319 |
|
326 | |||
320 | $ hg rebase --source 2 --dest 7 |
|
327 | $ hg rebase --source 2 --dest 7 | |
321 | rebasing 2:5fddd98957c8 "C" |
|
328 | rebasing 2:5fddd98957c8 "C" | |
322 | rebasing 3:32af7686d403 "D" |
|
329 | rebasing 3:32af7686d403 "D" | |
323 | saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-f9244fa1-rebase.hg |
|
330 | saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-f9244fa1-rebase.hg | |
324 |
|
331 | |||
325 | $ hg tglog |
|
332 | $ hg tglog | |
326 | o 8: 668acadedd30 'D' |
|
333 | o 8: 668acadedd30 'D' | |
327 | | |
|
334 | | | |
328 | o 7: 09eb682ba906 'C' |
|
335 | o 7: 09eb682ba906 'C' | |
329 | | |
|
336 | | | |
330 | | @ 6: e7ec4e813ba6 'I' |
|
337 | | @ 6: e7ec4e813ba6 'I' | |
331 | |/ |
|
338 | |/ | |
332 | o 5: 02de42196ebe 'H' |
|
339 | o 5: 02de42196ebe 'H' | |
333 | | |
|
340 | | | |
334 | | o 4: eea13746799a 'G' |
|
341 | | o 4: eea13746799a 'G' | |
335 | |/| |
|
342 | |/| | |
336 | o | 3: 24b6387c8c8c 'F' |
|
343 | o | 3: 24b6387c8c8c 'F' | |
337 | | | |
|
344 | | | | |
338 | | o 2: 9520eea781bc 'E' |
|
345 | | o 2: 9520eea781bc 'E' | |
339 | |/ |
|
346 | |/ | |
340 | | o 1: 42ccdea3bb16 'B' |
|
347 | | o 1: 42ccdea3bb16 'B' | |
341 | |/ |
|
348 | |/ | |
342 | o 0: cd010b8cd998 'A' |
|
349 | o 0: cd010b8cd998 'A' | |
343 |
|
350 | |||
344 | $ cd .. |
|
351 | $ cd .. | |
345 |
|
352 | |||
346 |
|
353 | |||
347 | Specify base and dest (from 1 onto 7): |
|
354 | Specify base and dest (from 1 onto 7): | |
348 |
|
355 | |||
349 | $ hg clone -q -u . a a8 |
|
356 | $ hg clone -q -u . a a8 | |
350 | $ cd a8 |
|
357 | $ cd a8 | |
351 |
|
358 | |||
352 | $ hg rebase --base 3 --dest 7 |
|
359 | $ hg rebase --base 3 --dest 7 | |
353 | rebasing 1:42ccdea3bb16 "B" |
|
360 | rebasing 1:42ccdea3bb16 "B" | |
354 | rebasing 2:5fddd98957c8 "C" |
|
361 | rebasing 2:5fddd98957c8 "C" | |
355 | rebasing 3:32af7686d403 "D" |
|
362 | rebasing 3:32af7686d403 "D" | |
356 | saved backup bundle to $TESTTMP/a8/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg |
|
363 | saved backup bundle to $TESTTMP/a8/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg | |
357 |
|
364 | |||
358 | $ hg tglog |
|
365 | $ hg tglog | |
359 | o 8: 287cc92ba5a4 'D' |
|
366 | o 8: 287cc92ba5a4 'D' | |
360 | | |
|
367 | | | |
361 | o 7: 6824f610a250 'C' |
|
368 | o 7: 6824f610a250 'C' | |
362 | | |
|
369 | | | |
363 | o 6: 7c6027df6a99 'B' |
|
370 | o 6: 7c6027df6a99 'B' | |
364 | | |
|
371 | | | |
365 | | @ 5: e7ec4e813ba6 'I' |
|
372 | | @ 5: e7ec4e813ba6 'I' | |
366 | |/ |
|
373 | |/ | |
367 | o 4: 02de42196ebe 'H' |
|
374 | o 4: 02de42196ebe 'H' | |
368 | | |
|
375 | | | |
369 | | o 3: eea13746799a 'G' |
|
376 | | o 3: eea13746799a 'G' | |
370 | |/| |
|
377 | |/| | |
371 | o | 2: 24b6387c8c8c 'F' |
|
378 | o | 2: 24b6387c8c8c 'F' | |
372 | | | |
|
379 | | | | |
373 | | o 1: 9520eea781bc 'E' |
|
380 | | o 1: 9520eea781bc 'E' | |
374 | |/ |
|
381 | |/ | |
375 | o 0: cd010b8cd998 'A' |
|
382 | o 0: cd010b8cd998 'A' | |
376 |
|
383 | |||
377 | $ cd .. |
|
384 | $ cd .. | |
378 |
|
385 | |||
379 |
|
386 | |||
380 | Specify only revs (from 2 onto 8) |
|
387 | Specify only revs (from 2 onto 8) | |
381 |
|
388 | |||
382 | $ hg clone -q -u . a2heads a9 |
|
389 | $ hg clone -q -u . a2heads a9 | |
383 | $ cd a9 |
|
390 | $ cd a9 | |
384 |
|
391 | |||
385 | $ hg rebase --rev 'desc("C")::' |
|
392 | $ hg rebase --rev 'desc("C")::' | |
386 | rebasing 2:5fddd98957c8 "C" |
|
393 | rebasing 2:5fddd98957c8 "C" | |
387 | rebasing 3:32af7686d403 "D" |
|
394 | rebasing 3:32af7686d403 "D" | |
388 | saved backup bundle to $TESTTMP/a9/.hg/strip-backup/5fddd98957c8-f9244fa1-rebase.hg |
|
395 | saved backup bundle to $TESTTMP/a9/.hg/strip-backup/5fddd98957c8-f9244fa1-rebase.hg | |
389 |
|
396 | |||
390 | $ hg tglog |
|
397 | $ hg tglog | |
391 | o 6: 7726e9fd58f7 'D' |
|
398 | o 6: 7726e9fd58f7 'D' | |
392 | | |
|
399 | | | |
393 | o 5: 72c8333623d0 'C' |
|
400 | o 5: 72c8333623d0 'C' | |
394 | | |
|
401 | | | |
395 | @ 4: e7ec4e813ba6 'I' |
|
402 | @ 4: e7ec4e813ba6 'I' | |
396 | | |
|
403 | | | |
397 | o 3: 02de42196ebe 'H' |
|
404 | o 3: 02de42196ebe 'H' | |
398 | | |
|
405 | | | |
399 | o 2: 24b6387c8c8c 'F' |
|
406 | o 2: 24b6387c8c8c 'F' | |
400 | | |
|
407 | | | |
401 | | o 1: 42ccdea3bb16 'B' |
|
408 | | o 1: 42ccdea3bb16 'B' | |
402 | |/ |
|
409 | |/ | |
403 | o 0: cd010b8cd998 'A' |
|
410 | o 0: cd010b8cd998 'A' | |
404 |
|
411 | |||
405 | $ cd .. |
|
412 | $ cd .. | |
406 |
|
413 | |||
407 | Rebasing both a single revision and a merge in one command |
|
414 | Rebasing both a single revision and a merge in one command | |
408 |
|
415 | |||
409 | $ hg clone -q -u . a aX |
|
416 | $ hg clone -q -u . a aX | |
410 | $ cd aX |
|
417 | $ cd aX | |
411 | $ hg rebase -r 3 -r 6 --dest 8 |
|
418 | $ hg rebase -r 3 -r 6 --dest 8 | |
412 | rebasing 3:32af7686d403 "D" |
|
419 | rebasing 3:32af7686d403 "D" | |
413 | rebasing 6:eea13746799a "G" |
|
420 | rebasing 6:eea13746799a "G" | |
414 | saved backup bundle to $TESTTMP/aX/.hg/strip-backup/eea13746799a-ad273fd6-rebase.hg |
|
421 | saved backup bundle to $TESTTMP/aX/.hg/strip-backup/eea13746799a-ad273fd6-rebase.hg | |
415 | $ cd .. |
|
422 | $ cd .. | |
416 |
|
423 | |||
417 | Test --tool parameter: |
|
424 | Test --tool parameter: | |
418 |
|
425 | |||
419 | $ hg init b |
|
426 | $ hg init b | |
420 | $ cd b |
|
427 | $ cd b | |
421 |
|
428 | |||
422 | $ echo c1 > c1 |
|
429 | $ echo c1 > c1 | |
423 | $ hg ci -Am c1 |
|
430 | $ hg ci -Am c1 | |
424 | adding c1 |
|
431 | adding c1 | |
425 |
|
432 | |||
426 | $ echo c2 > c2 |
|
433 | $ echo c2 > c2 | |
427 | $ hg ci -Am c2 |
|
434 | $ hg ci -Am c2 | |
428 | adding c2 |
|
435 | adding c2 | |
429 |
|
436 | |||
430 | $ hg up -q 0 |
|
437 | $ hg up -q 0 | |
431 | $ echo c2b > c2 |
|
438 | $ echo c2b > c2 | |
432 | $ hg ci -Am c2b |
|
439 | $ hg ci -Am c2b | |
433 | adding c2 |
|
440 | adding c2 | |
434 | created new head |
|
441 | created new head | |
435 |
|
442 | |||
436 | $ cd .. |
|
443 | $ cd .. | |
437 |
|
444 | |||
438 | $ hg clone -q -u . b b1 |
|
445 | $ hg clone -q -u . b b1 | |
439 | $ cd b1 |
|
446 | $ cd b1 | |
440 |
|
447 | |||
441 | $ hg rebase -s 2 -d 1 --tool internal:local |
|
448 | $ hg rebase -s 2 -d 1 --tool internal:local | |
442 | rebasing 2:e4e3f3546619 "c2b" (tip) |
|
449 | rebasing 2:e4e3f3546619 "c2b" (tip) | |
443 | note: not rebasing 2:e4e3f3546619 "c2b" (tip), its destination already has all its changes |
|
450 | note: not rebasing 2:e4e3f3546619 "c2b" (tip), its destination already has all its changes | |
444 | saved backup bundle to $TESTTMP/b1/.hg/strip-backup/e4e3f3546619-b0841178-rebase.hg |
|
451 | saved backup bundle to $TESTTMP/b1/.hg/strip-backup/e4e3f3546619-b0841178-rebase.hg | |
445 |
|
452 | |||
446 | $ hg cat c2 |
|
453 | $ hg cat c2 | |
447 | c2 |
|
454 | c2 | |
448 |
|
455 | |||
449 | $ cd .. |
|
456 | $ cd .. | |
450 |
|
457 | |||
451 |
|
458 | |||
452 | $ hg clone -q -u . b b2 |
|
459 | $ hg clone -q -u . b b2 | |
453 | $ cd b2 |
|
460 | $ cd b2 | |
454 |
|
461 | |||
455 | $ hg rebase -s 2 -d 1 --tool internal:other |
|
462 | $ hg rebase -s 2 -d 1 --tool internal:other | |
456 | rebasing 2:e4e3f3546619 "c2b" (tip) |
|
463 | rebasing 2:e4e3f3546619 "c2b" (tip) | |
457 | saved backup bundle to $TESTTMP/b2/.hg/strip-backup/e4e3f3546619-b0841178-rebase.hg |
|
464 | saved backup bundle to $TESTTMP/b2/.hg/strip-backup/e4e3f3546619-b0841178-rebase.hg | |
458 |
|
465 | |||
459 | $ hg cat c2 |
|
466 | $ hg cat c2 | |
460 | c2b |
|
467 | c2b | |
461 |
|
468 | |||
462 | $ cd .. |
|
469 | $ cd .. | |
463 |
|
470 | |||
464 |
|
471 | |||
465 | $ hg clone -q -u . b b3 |
|
472 | $ hg clone -q -u . b b3 | |
466 | $ cd b3 |
|
473 | $ cd b3 | |
467 |
|
474 | |||
468 | $ hg rebase -s 2 -d 1 --tool internal:fail |
|
475 | $ hg rebase -s 2 -d 1 --tool internal:fail | |
469 | rebasing 2:e4e3f3546619 "c2b" (tip) |
|
476 | rebasing 2:e4e3f3546619 "c2b" (tip) | |
470 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
477 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
471 | [1] |
|
478 | [1] | |
472 |
|
479 | |||
473 | $ hg summary |
|
480 | $ hg summary | |
474 | parent: 1:56daeba07f4b |
|
481 | parent: 1:56daeba07f4b | |
475 | c2 |
|
482 | c2 | |
476 | parent: 2:e4e3f3546619 tip |
|
483 | parent: 2:e4e3f3546619 tip | |
477 | c2b |
|
484 | c2b | |
478 | branch: default |
|
485 | branch: default | |
479 | commit: 1 modified, 1 unresolved (merge) |
|
486 | commit: 1 modified, 1 unresolved (merge) | |
480 | update: (current) |
|
487 | update: (current) | |
481 | phases: 3 draft |
|
488 | phases: 3 draft | |
482 | rebase: 0 rebased, 1 remaining (rebase --continue) |
|
489 | rebase: 0 rebased, 1 remaining (rebase --continue) | |
483 |
|
490 | |||
484 | $ hg resolve -l |
|
491 | $ hg resolve -l | |
485 | U c2 |
|
492 | U c2 | |
486 |
|
493 | |||
487 | $ hg resolve -m c2 |
|
494 | $ hg resolve -m c2 | |
488 | (no more unresolved files) |
|
495 | (no more unresolved files) | |
489 | continue: hg rebase --continue |
|
496 | continue: hg rebase --continue | |
490 | $ hg graft --continue |
|
497 | $ hg graft --continue | |
491 | abort: no graft in progress |
|
498 | abort: no graft in progress | |
492 | (continue: hg rebase --continue) |
|
499 | (continue: hg rebase --continue) | |
493 | [255] |
|
500 | [255] | |
494 | $ hg rebase -c --tool internal:fail |
|
501 | $ hg rebase -c --tool internal:fail | |
495 | rebasing 2:e4e3f3546619 "c2b" (tip) |
|
502 | rebasing 2:e4e3f3546619 "c2b" (tip) | |
496 | note: not rebasing 2:e4e3f3546619 "c2b" (tip), its destination already has all its changes |
|
503 | note: not rebasing 2:e4e3f3546619 "c2b" (tip), its destination already has all its changes | |
497 | saved backup bundle to $TESTTMP/b3/.hg/strip-backup/e4e3f3546619-b0841178-rebase.hg |
|
504 | saved backup bundle to $TESTTMP/b3/.hg/strip-backup/e4e3f3546619-b0841178-rebase.hg | |
498 |
|
505 | |||
499 | $ hg rebase -i |
|
506 | $ hg rebase -i | |
500 | abort: interactive history editing is supported by the 'histedit' extension (see "hg --config extensions.histedit= help -e histedit") |
|
507 | abort: interactive history editing is supported by the 'histedit' extension (see "hg --config extensions.histedit= help -e histedit") | |
501 | [255] |
|
508 | [255] | |
502 |
|
509 | |||
503 | $ hg rebase --interactive |
|
510 | $ hg rebase --interactive | |
504 | abort: interactive history editing is supported by the 'histedit' extension (see "hg --config extensions.histedit= help -e histedit") |
|
511 | abort: interactive history editing is supported by the 'histedit' extension (see "hg --config extensions.histedit= help -e histedit") | |
505 | [255] |
|
512 | [255] | |
506 |
|
513 | |||
507 | $ cd .. |
|
514 | $ cd .. | |
508 |
|
515 | |||
509 | No common ancestor |
|
516 | No common ancestor | |
510 |
|
517 | |||
511 | $ hg init separaterepo |
|
518 | $ hg init separaterepo | |
512 | $ cd separaterepo |
|
519 | $ cd separaterepo | |
513 | $ touch a |
|
520 | $ touch a | |
514 | $ hg commit -Aqm a |
|
521 | $ hg commit -Aqm a | |
515 | $ hg up -q null |
|
522 | $ hg up -q null | |
516 | $ touch b |
|
523 | $ touch b | |
517 | $ hg commit -Aqm b |
|
524 | $ hg commit -Aqm b | |
518 | $ hg rebase -d 0 |
|
525 | $ hg rebase -d 0 | |
519 | nothing to rebase from d7486e00c6f1 to 3903775176ed |
|
526 | nothing to rebase from d7486e00c6f1 to 3903775176ed | |
520 | [1] |
|
527 | [1] | |
521 | $ cd .. |
|
528 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now