Show More
@@ -1,453 +1,465 b'' | |||||
1 | Require a destination |
|
1 | Require a destination | |
2 | $ cat >> $HGRCPATH <<EOF |
|
2 | $ cat >> $HGRCPATH <<EOF | |
3 | > [extensions] |
|
3 | > [extensions] | |
4 | > rebase = |
|
4 | > rebase = | |
5 | > [commands] |
|
5 | > [commands] | |
6 | > rebase.requiredest = True |
|
6 | > rebase.requiredest = True | |
7 | > EOF |
|
7 | > EOF | |
8 | $ hg init repo |
|
8 | $ hg init repo | |
9 | $ cd repo |
|
9 | $ cd repo | |
10 | $ echo a >> a |
|
10 | $ echo a >> a | |
11 | $ hg commit -qAm aa |
|
11 | $ hg commit -qAm aa | |
12 | $ echo b >> b |
|
12 | $ echo b >> b | |
13 | $ hg commit -qAm bb |
|
13 | $ hg commit -qAm bb | |
14 | $ hg up ".^" |
|
14 | $ hg up ".^" | |
15 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
15 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
16 | $ echo c >> c |
|
16 | $ echo c >> c | |
17 | $ hg commit -qAm cc |
|
17 | $ hg commit -qAm cc | |
18 | $ hg rebase |
|
18 | $ hg rebase | |
19 | abort: you must specify a destination |
|
19 | abort: you must specify a destination | |
20 | (use: hg rebase -d REV) |
|
20 | (use: hg rebase -d REV) | |
21 | [255] |
|
21 | [255] | |
22 | $ hg rebase -d 1 |
|
22 | $ hg rebase -d 1 | |
23 | rebasing 2:5db65b93a12b "cc" (tip) |
|
23 | rebasing 2:5db65b93a12b "cc" (tip) | |
24 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/5db65b93a12b-4fb789ec-rebase.hg |
|
24 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/5db65b93a12b-4fb789ec-rebase.hg | |
25 | $ hg rebase -d 0 -r . -q |
|
25 | $ hg rebase -d 0 -r . -q | |
26 | $ HGPLAIN=1 hg rebase |
|
26 | $ HGPLAIN=1 hg rebase | |
27 | rebasing 2:889b0bc6a730 "cc" (tip) |
|
27 | rebasing 2:889b0bc6a730 "cc" (tip) | |
28 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/889b0bc6a730-41ec4f81-rebase.hg |
|
28 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/889b0bc6a730-41ec4f81-rebase.hg | |
29 | $ hg rebase -d 0 -r . -q |
|
29 | $ hg rebase -d 0 -r . -q | |
30 | $ hg --config commands.rebase.requiredest=False rebase |
|
30 | $ hg --config commands.rebase.requiredest=False rebase | |
31 | rebasing 2:279de9495438 "cc" (tip) |
|
31 | rebasing 2:279de9495438 "cc" (tip) | |
32 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/279de9495438-ab0a5128-rebase.hg |
|
32 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/279de9495438-ab0a5128-rebase.hg | |
33 |
|
33 | |||
34 | Requiring dest should not break continue or other rebase options |
|
34 | Requiring dest should not break continue or other rebase options | |
35 | $ hg up 1 -q |
|
35 | $ hg up 1 -q | |
36 | $ echo d >> c |
|
36 | $ echo d >> c | |
37 | $ hg commit -qAm dc |
|
37 | $ hg commit -qAm dc | |
38 | $ hg log -G -T '{rev} {desc}' |
|
38 | $ hg log -G -T '{rev} {desc}' | |
39 | @ 3 dc |
|
39 | @ 3 dc | |
40 | | |
|
40 | | | |
41 | | o 2 cc |
|
41 | | o 2 cc | |
42 | |/ |
|
42 | |/ | |
43 | o 1 bb |
|
43 | o 1 bb | |
44 | | |
|
44 | | | |
45 | o 0 aa |
|
45 | o 0 aa | |
46 |
|
46 | |||
47 | $ hg rebase -d 2 |
|
47 | $ hg rebase -d 2 | |
48 | rebasing 3:0537f6b50def "dc" (tip) |
|
48 | rebasing 3:0537f6b50def "dc" (tip) | |
49 | merging c |
|
49 | merging c | |
50 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') |
|
50 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') | |
51 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
51 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
52 | [1] |
|
52 | [1] | |
53 | $ echo d > c |
|
53 | $ echo d > c | |
54 | $ hg resolve --mark --all |
|
54 | $ hg resolve --mark --all | |
55 | (no more unresolved files) |
|
55 | (no more unresolved files) | |
56 | continue: hg rebase --continue |
|
56 | continue: hg rebase --continue | |
57 | $ hg rebase --continue |
|
57 | $ hg rebase --continue | |
58 | rebasing 3:0537f6b50def "dc" (tip) |
|
58 | rebasing 3:0537f6b50def "dc" (tip) | |
59 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/0537f6b50def-be4c7386-rebase.hg |
|
59 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/0537f6b50def-be4c7386-rebase.hg | |
60 |
|
60 | |||
61 | $ cd .. |
|
61 | $ cd .. | |
62 |
|
62 | |||
63 | Check rebase.requiredest interaction with pull --rebase |
|
63 | Check rebase.requiredest interaction with pull --rebase | |
64 | $ hg clone repo clone |
|
64 | $ hg clone repo clone | |
65 | updating to branch default |
|
65 | updating to branch default | |
66 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
66 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
67 | $ cd repo |
|
67 | $ cd repo | |
68 | $ echo e > e |
|
68 | $ echo e > e | |
69 | $ hg commit -qAm ee |
|
69 | $ hg commit -qAm ee | |
70 | $ cd .. |
|
70 | $ cd .. | |
71 | $ cd clone |
|
71 | $ cd clone | |
72 | $ echo f > f |
|
72 | $ echo f > f | |
73 | $ hg commit -qAm ff |
|
73 | $ hg commit -qAm ff | |
74 | $ hg pull --rebase |
|
74 | $ hg pull --rebase | |
75 | abort: rebase destination required by configuration |
|
75 | abort: rebase destination required by configuration | |
76 | (use hg pull followed by hg rebase -d DEST) |
|
76 | (use hg pull followed by hg rebase -d DEST) | |
77 | [255] |
|
77 | [255] | |
78 |
|
78 | |||
79 | Setup rebase with multiple destinations |
|
79 | Setup rebase with multiple destinations | |
80 |
|
80 | |||
81 | $ cd $TESTTMP |
|
81 | $ cd $TESTTMP | |
82 |
|
82 | |||
83 | $ cat >> $TESTTMP/maprevset.py <<EOF |
|
83 | $ cat >> $TESTTMP/maprevset.py <<EOF | |
84 | > from __future__ import absolute_import |
|
84 | > from __future__ import absolute_import | |
85 | > from mercurial import registrar, revset, revsetlang, smartset |
|
85 | > from mercurial import registrar, revset, revsetlang, smartset | |
86 | > revsetpredicate = registrar.revsetpredicate() |
|
86 | > revsetpredicate = registrar.revsetpredicate() | |
87 | > cache = {} |
|
87 | > cache = {} | |
88 | > @revsetpredicate(b'map') |
|
88 | > @revsetpredicate(b'map') | |
89 | > def map(repo, subset, x): |
|
89 | > def map(repo, subset, x): | |
90 | > """(set, mapping)""" |
|
90 | > """(set, mapping)""" | |
91 | > setarg, maparg = revsetlang.getargs(x, 2, 2, b'') |
|
91 | > setarg, maparg = revsetlang.getargs(x, 2, 2, b'') | |
92 | > rset = revset.getset(repo, smartset.fullreposet(repo), setarg) |
|
92 | > rset = revset.getset(repo, smartset.fullreposet(repo), setarg) | |
93 | > mapstr = revsetlang.getstring(maparg, b'') |
|
93 | > mapstr = revsetlang.getstring(maparg, b'') | |
94 | > map = dict(a.split(b':') for a in mapstr.split(b',')) |
|
94 | > map = dict(a.split(b':') for a in mapstr.split(b',')) | |
95 | > rev = rset.first() |
|
95 | > rev = rset.first() | |
96 | > desc = repo[rev].description() |
|
96 | > desc = repo[rev].description() | |
97 | > newdesc = map.get(desc) |
|
97 | > newdesc = map.get(desc) | |
98 | > if newdesc == b'null': |
|
98 | > if newdesc == b'null': | |
99 | > revs = [-1] |
|
99 | > revs = [-1] | |
100 | > else: |
|
100 | > else: | |
101 | > query = revsetlang.formatspec(b'desc(%s)', newdesc) |
|
101 | > query = revsetlang.formatspec(b'desc(%s)', newdesc) | |
102 | > revs = repo.revs(query) |
|
102 | > revs = repo.revs(query) | |
103 | > return smartset.baseset(revs) |
|
103 | > return smartset.baseset(revs) | |
104 | > EOF |
|
104 | > EOF | |
105 |
|
105 | |||
106 | $ cat >> $HGRCPATH <<EOF |
|
106 | $ cat >> $HGRCPATH <<EOF | |
107 | > [ui] |
|
107 | > [ui] | |
108 | > allowemptycommit=1 |
|
108 | > allowemptycommit=1 | |
109 | > [extensions] |
|
109 | > [extensions] | |
110 | > drawdag=$TESTDIR/drawdag.py |
|
110 | > drawdag=$TESTDIR/drawdag.py | |
111 | > [phases] |
|
111 | > [phases] | |
112 | > publish=False |
|
112 | > publish=False | |
113 | > [alias] |
|
113 | > [alias] | |
114 | > tglog = log -G --template "{rev}: {node|short} {desc} {instabilities}" -r 'sort(all(), topo)' |
|
114 | > tglog = log -G --template "{rev}: {node|short} {desc} {instabilities}" -r 'sort(all(), topo)' | |
115 | > [extensions] |
|
115 | > [extensions] | |
116 | > maprevset=$TESTTMP/maprevset.py |
|
116 | > maprevset=$TESTTMP/maprevset.py | |
117 | > [experimental] |
|
117 | > [experimental] | |
118 | > evolution=true |
|
118 | > evolution=true | |
119 | > EOF |
|
119 | > EOF | |
120 |
|
120 | |||
121 | $ rebasewithdag() { |
|
121 | $ rebasewithdag() { | |
122 | > N=`"$PYTHON" -c "print($N+1)"` |
|
122 | > N=`"$PYTHON" -c "print($N+1)"` | |
123 | > hg init repo$N && cd repo$N |
|
123 | > hg init repo$N && cd repo$N | |
124 | > hg debugdrawdag |
|
124 | > hg debugdrawdag | |
125 | > hg rebase "$@" > _rebasetmp |
|
125 | > hg rebase "$@" > _rebasetmp | |
126 | > r=$? |
|
126 | > r=$? | |
127 | > grep -v 'saved backup bundle' _rebasetmp |
|
127 | > grep -v 'saved backup bundle' _rebasetmp | |
128 | > [ $r -eq 0 ] && rm -f .hg/localtags && hg tglog |
|
128 | > [ $r -eq 0 ] && rm -f .hg/localtags && hg tglog | |
129 | > cd .. |
|
129 | > cd .. | |
130 | > return $r |
|
130 | > return $r | |
131 | > } |
|
131 | > } | |
132 |
|
132 | |||
133 | Destination resolves to an empty set: |
|
133 | Destination resolves to an empty set: | |
134 |
|
134 | |||
135 | $ rebasewithdag -s B -d 'SRC - SRC' <<'EOS' |
|
135 | $ rebasewithdag -s B -d 'SRC - SRC' <<'EOS' | |
136 | > C |
|
136 | > C | |
137 | > | |
|
137 | > | | |
138 | > B |
|
138 | > B | |
139 | > | |
|
139 | > | | |
140 | > A |
|
140 | > A | |
141 | > EOS |
|
141 | > EOS | |
142 | nothing to rebase - empty destination |
|
142 | nothing to rebase - empty destination | |
143 | [1] |
|
143 | [1] | |
144 |
|
144 | |||
145 | Multiple destinations and --collapse are not compatible: |
|
145 | Multiple destinations and --collapse are not compatible: | |
146 |
|
146 | |||
147 | $ rebasewithdag -s C+E -d 'SRC^^' --collapse <<'EOS' |
|
147 | $ rebasewithdag -s C+E -d 'SRC^^' --collapse <<'EOS' | |
148 | > C F |
|
148 | > C F | |
149 | > | | |
|
149 | > | | | |
150 | > B E |
|
150 | > B E | |
151 | > | | |
|
151 | > | | | |
152 | > A D |
|
152 | > A D | |
153 | > EOS |
|
153 | > EOS | |
154 | abort: --collapse does not work with multiple destinations |
|
154 | abort: --collapse does not work with multiple destinations | |
155 | [255] |
|
155 | [255] | |
156 |
|
156 | |||
157 | Multiple destinations cannot be used with --base: |
|
157 | Multiple destinations cannot be used with --base: | |
158 |
|
158 | |||
159 | $ rebasewithdag -b B+E -d 'SRC^^' --collapse <<'EOS' |
|
159 | $ rebasewithdag -b B+E -d 'SRC^^' --collapse <<'EOS' | |
160 | > B E |
|
160 | > B E | |
161 | > | | |
|
161 | > | | | |
162 | > A D |
|
162 | > A D | |
163 | > EOS |
|
163 | > EOS | |
164 | abort: unknown revision 'SRC'! |
|
164 | abort: unknown revision 'SRC'! | |
165 | [255] |
|
165 | [255] | |
166 |
|
166 | |||
167 | Rebase to null should work: |
|
167 | Rebase to null should work: | |
168 |
|
168 | |||
169 | $ rebasewithdag -r A+C+D -d 'null' <<'EOS' |
|
169 | $ rebasewithdag -r A+C+D -d 'null' <<'EOS' | |
170 | > C D |
|
170 | > C D | |
171 | > | | |
|
171 | > | | | |
172 | > A B |
|
172 | > A B | |
173 | > EOS |
|
173 | > EOS | |
174 | already rebased 0:426bada5c675 "A" (A) |
|
174 | already rebased 0:426bada5c675 "A" (A) | |
175 | already rebased 2:dc0947a82db8 "C" (C) |
|
175 | already rebased 2:dc0947a82db8 "C" (C) | |
176 | rebasing 3:004dc1679908 "D" (D tip) |
|
176 | rebasing 3:004dc1679908 "D" (D tip) | |
177 | o 4: d8d8601abd5e D |
|
177 | o 4: d8d8601abd5e D | |
178 |
|
178 | |||
179 | o 2: dc0947a82db8 C |
|
179 | o 2: dc0947a82db8 C | |
180 | | |
|
180 | | | |
181 | | o 1: fc2b737bb2e5 B |
|
181 | | o 1: fc2b737bb2e5 B | |
182 | | |
|
182 | | | |
183 | o 0: 426bada5c675 A |
|
183 | o 0: 426bada5c675 A | |
184 |
|
184 | |||
185 | Destination resolves to multiple changesets: |
|
185 | Destination resolves to multiple changesets: | |
186 |
|
186 | |||
187 | $ rebasewithdag -s B -d 'ALLSRC+SRC' <<'EOS' |
|
187 | $ rebasewithdag -s B -d 'ALLSRC+SRC' <<'EOS' | |
188 | > C |
|
188 | > C | |
189 | > | |
|
189 | > | | |
190 | > B |
|
190 | > B | |
191 | > | |
|
191 | > | | |
192 | > Z |
|
192 | > Z | |
193 | > EOS |
|
193 | > EOS | |
194 | abort: rebase destination for f0a671a46792 is not unique |
|
194 | abort: rebase destination for f0a671a46792 is not unique | |
195 | [255] |
|
195 | [255] | |
196 |
|
196 | |||
197 | Destination is an ancestor of source: |
|
197 | Destination is an ancestor of source: | |
198 |
|
198 | |||
199 | $ rebasewithdag -s B -d 'SRC' <<'EOS' |
|
199 | $ rebasewithdag -s B -d 'SRC' <<'EOS' | |
200 | > C |
|
200 | > C | |
201 | > | |
|
201 | > | | |
202 | > B |
|
202 | > B | |
203 | > | |
|
203 | > | | |
204 | > Z |
|
204 | > Z | |
205 | > EOS |
|
205 | > EOS | |
206 | abort: source and destination form a cycle |
|
206 | abort: source and destination form a cycle | |
207 | [255] |
|
207 | [255] | |
208 |
|
208 | |||
|
209 | BUG: cycles aren't flagged correctly when --dry-run is set: | |||
|
210 | $ rebasewithdag -s B -d 'SRC' --dry-run <<'EOS' | |||
|
211 | > C | |||
|
212 | > | | |||
|
213 | > B | |||
|
214 | > | | |||
|
215 | > Z | |||
|
216 | > EOS | |||
|
217 | abort: no rebase in progress | |||
|
218 | starting dry-run rebase; repository will not be changed | |||
|
219 | [255] | |||
|
220 | ||||
209 | Switch roots: |
|
221 | Switch roots: | |
210 |
|
222 | |||
211 | $ rebasewithdag -s 'all() - roots(all())' -d 'roots(all()) - ::SRC' <<'EOS' |
|
223 | $ rebasewithdag -s 'all() - roots(all())' -d 'roots(all()) - ::SRC' <<'EOS' | |
212 | > C F |
|
224 | > C F | |
213 | > | | |
|
225 | > | | | |
214 | > B E |
|
226 | > B E | |
215 | > | | |
|
227 | > | | | |
216 | > A D |
|
228 | > A D | |
217 | > EOS |
|
229 | > EOS | |
218 | rebasing 2:112478962961 "B" (B) |
|
230 | rebasing 2:112478962961 "B" (B) | |
219 | rebasing 4:26805aba1e60 "C" (C) |
|
231 | rebasing 4:26805aba1e60 "C" (C) | |
220 | rebasing 3:cd488e83d208 "E" (E) |
|
232 | rebasing 3:cd488e83d208 "E" (E) | |
221 | rebasing 5:0069ba24938a "F" (F tip) |
|
233 | rebasing 5:0069ba24938a "F" (F tip) | |
222 | o 9: d150ff263fc8 F |
|
234 | o 9: d150ff263fc8 F | |
223 | | |
|
235 | | | |
224 | o 8: 66f30a1a2eab E |
|
236 | o 8: 66f30a1a2eab E | |
225 | | |
|
237 | | | |
226 | | o 7: 93db94ffae0e C |
|
238 | | o 7: 93db94ffae0e C | |
227 | | | |
|
239 | | | | |
228 | | o 6: d0071c3b0c88 B |
|
240 | | o 6: d0071c3b0c88 B | |
229 | | | |
|
241 | | | | |
230 | | o 1: 058c1e1fb10a D |
|
242 | | o 1: 058c1e1fb10a D | |
231 | | |
|
243 | | | |
232 | o 0: 426bada5c675 A |
|
244 | o 0: 426bada5c675 A | |
233 |
|
245 | |||
234 | Different destinations for merge changesets with a same root: |
|
246 | Different destinations for merge changesets with a same root: | |
235 |
|
247 | |||
236 | $ rebasewithdag -s B -d '((parents(SRC)-B-A)::) - (::ALLSRC)' <<'EOS' |
|
248 | $ rebasewithdag -s B -d '((parents(SRC)-B-A)::) - (::ALLSRC)' <<'EOS' | |
237 | > C G |
|
249 | > C G | |
238 | > |\| |
|
250 | > |\| | |
239 | > | F |
|
251 | > | F | |
240 | > | |
|
252 | > | | |
241 | > B E |
|
253 | > B E | |
242 | > |\| |
|
254 | > |\| | |
243 | > A D |
|
255 | > A D | |
244 | > EOS |
|
256 | > EOS | |
245 | rebasing 3:a4256619d830 "B" (B) |
|
257 | rebasing 3:a4256619d830 "B" (B) | |
246 | rebasing 6:8e139e245220 "C" (C tip) |
|
258 | rebasing 6:8e139e245220 "C" (C tip) | |
247 | o 8: 51e2ce92e06a C |
|
259 | o 8: 51e2ce92e06a C | |
248 | |\ |
|
260 | |\ | |
249 | | o 7: 2ed0c8546285 B |
|
261 | | o 7: 2ed0c8546285 B | |
250 | | |\ |
|
262 | | |\ | |
251 | o | | 5: 8fdb2c1feb20 G |
|
263 | o | | 5: 8fdb2c1feb20 G | |
252 | | | | |
|
264 | | | | | |
253 | | | o 4: cd488e83d208 E |
|
265 | | | o 4: cd488e83d208 E | |
254 | | | | |
|
266 | | | | | |
255 | o | | 2: a6661b868de9 F |
|
267 | o | | 2: a6661b868de9 F | |
256 | / / |
|
268 | / / | |
257 | | o 1: 058c1e1fb10a D |
|
269 | | o 1: 058c1e1fb10a D | |
258 | | |
|
270 | | | |
259 | o 0: 426bada5c675 A |
|
271 | o 0: 426bada5c675 A | |
260 |
|
272 | |||
261 | Move to a previous parent: |
|
273 | Move to a previous parent: | |
262 |
|
274 | |||
263 | $ rebasewithdag -s E+F+G -d 'SRC^^' <<'EOS' |
|
275 | $ rebasewithdag -s E+F+G -d 'SRC^^' <<'EOS' | |
264 | > H |
|
276 | > H | |
265 | > | |
|
277 | > | | |
266 | > D G |
|
278 | > D G | |
267 | > |/ |
|
279 | > |/ | |
268 | > C F |
|
280 | > C F | |
269 | > |/ |
|
281 | > |/ | |
270 | > B E # E will be ignored, since E^^ is empty |
|
282 | > B E # E will be ignored, since E^^ is empty | |
271 | > |/ |
|
283 | > |/ | |
272 | > A |
|
284 | > A | |
273 | > EOS |
|
285 | > EOS | |
274 | rebasing 4:33441538d4aa "F" (F) |
|
286 | rebasing 4:33441538d4aa "F" (F) | |
275 | rebasing 6:cf43ad9da869 "G" (G) |
|
287 | rebasing 6:cf43ad9da869 "G" (G) | |
276 | rebasing 7:eef94f3b5f03 "H" (H tip) |
|
288 | rebasing 7:eef94f3b5f03 "H" (H tip) | |
277 | o 10: b3d84c6666cf H |
|
289 | o 10: b3d84c6666cf H | |
278 | | |
|
290 | | | |
279 | | o 5: f585351a92f8 D |
|
291 | | o 5: f585351a92f8 D | |
280 | |/ |
|
292 | |/ | |
281 | o 3: 26805aba1e60 C |
|
293 | o 3: 26805aba1e60 C | |
282 | | |
|
294 | | | |
283 | | o 9: f7c28a1a15e2 G |
|
295 | | o 9: f7c28a1a15e2 G | |
284 | |/ |
|
296 | |/ | |
285 | o 1: 112478962961 B |
|
297 | o 1: 112478962961 B | |
286 | | |
|
298 | | | |
287 | | o 8: 02aa697facf7 F |
|
299 | | o 8: 02aa697facf7 F | |
288 | |/ |
|
300 | |/ | |
289 | | o 2: 7fb047a69f22 E |
|
301 | | o 2: 7fb047a69f22 E | |
290 | |/ |
|
302 | |/ | |
291 | o 0: 426bada5c675 A |
|
303 | o 0: 426bada5c675 A | |
292 |
|
304 | |||
293 | Source overlaps with destination: |
|
305 | Source overlaps with destination: | |
294 |
|
306 | |||
295 | $ rebasewithdag -s 'B+C+D' -d 'map(SRC, "B:C,C:D")' <<'EOS' |
|
307 | $ rebasewithdag -s 'B+C+D' -d 'map(SRC, "B:C,C:D")' <<'EOS' | |
296 | > B C D |
|
308 | > B C D | |
297 | > \|/ |
|
309 | > \|/ | |
298 | > A |
|
310 | > A | |
299 | > EOS |
|
311 | > EOS | |
300 | rebasing 2:dc0947a82db8 "C" (C) |
|
312 | rebasing 2:dc0947a82db8 "C" (C) | |
301 | rebasing 1:112478962961 "B" (B) |
|
313 | rebasing 1:112478962961 "B" (B) | |
302 | o 5: 5fe9935d5222 B |
|
314 | o 5: 5fe9935d5222 B | |
303 | | |
|
315 | | | |
304 | o 4: 12d20731b9e0 C |
|
316 | o 4: 12d20731b9e0 C | |
305 | | |
|
317 | | | |
306 | o 3: b18e25de2cf5 D |
|
318 | o 3: b18e25de2cf5 D | |
307 | | |
|
319 | | | |
308 | o 0: 426bada5c675 A |
|
320 | o 0: 426bada5c675 A | |
309 |
|
321 | |||
310 | Detect cycles early: |
|
322 | Detect cycles early: | |
311 |
|
323 | |||
312 | $ rebasewithdag -r 'all()-Z' -d 'map(SRC, "A:B,B:C,C:D,D:B")' <<'EOS' |
|
324 | $ rebasewithdag -r 'all()-Z' -d 'map(SRC, "A:B,B:C,C:D,D:B")' <<'EOS' | |
313 | > A B C |
|
325 | > A B C | |
314 | > \|/ |
|
326 | > \|/ | |
315 | > | D |
|
327 | > | D | |
316 | > |/ |
|
328 | > |/ | |
317 | > Z |
|
329 | > Z | |
318 | > EOS |
|
330 | > EOS | |
319 | abort: source and destination form a cycle |
|
331 | abort: source and destination form a cycle | |
320 | [255] |
|
332 | [255] | |
321 |
|
333 | |||
322 | Detect source is ancestor of dest in runtime: |
|
334 | Detect source is ancestor of dest in runtime: | |
323 |
|
335 | |||
324 | $ rebasewithdag -r 'C+B' -d 'map(SRC, "C:B,B:D")' -q <<'EOS' |
|
336 | $ rebasewithdag -r 'C+B' -d 'map(SRC, "C:B,B:D")' -q <<'EOS' | |
325 | > D |
|
337 | > D | |
326 | > | |
|
338 | > | | |
327 | > B C |
|
339 | > B C | |
328 | > \| |
|
340 | > \| | |
329 | > A |
|
341 | > A | |
330 | > EOS |
|
342 | > EOS | |
331 | abort: source is ancestor of destination |
|
343 | abort: source is ancestor of destination | |
332 | [255] |
|
344 | [255] | |
333 |
|
345 | |||
334 | "Already rebased" fast path still works: |
|
346 | "Already rebased" fast path still works: | |
335 |
|
347 | |||
336 | $ rebasewithdag -r 'all()' -d 'SRC^' <<'EOS' |
|
348 | $ rebasewithdag -r 'all()' -d 'SRC^' <<'EOS' | |
337 | > E F |
|
349 | > E F | |
338 | > /| | |
|
350 | > /| | | |
339 | > B C D |
|
351 | > B C D | |
340 | > \|/ |
|
352 | > \|/ | |
341 | > A |
|
353 | > A | |
342 | > EOS |
|
354 | > EOS | |
343 | already rebased 1:112478962961 "B" (B) |
|
355 | already rebased 1:112478962961 "B" (B) | |
344 | already rebased 2:dc0947a82db8 "C" (C) |
|
356 | already rebased 2:dc0947a82db8 "C" (C) | |
345 | already rebased 3:b18e25de2cf5 "D" (D) |
|
357 | already rebased 3:b18e25de2cf5 "D" (D) | |
346 | already rebased 4:312782b8f06e "E" (E) |
|
358 | already rebased 4:312782b8f06e "E" (E) | |
347 | already rebased 5:ad6717a6a58e "F" (F tip) |
|
359 | already rebased 5:ad6717a6a58e "F" (F tip) | |
348 | o 5: ad6717a6a58e F |
|
360 | o 5: ad6717a6a58e F | |
349 | | |
|
361 | | | |
350 | o 3: b18e25de2cf5 D |
|
362 | o 3: b18e25de2cf5 D | |
351 | | |
|
363 | | | |
352 | | o 4: 312782b8f06e E |
|
364 | | o 4: 312782b8f06e E | |
353 | | |\ |
|
365 | | |\ | |
354 | +---o 2: dc0947a82db8 C |
|
366 | +---o 2: dc0947a82db8 C | |
355 | | | |
|
367 | | | | |
356 | | o 1: 112478962961 B |
|
368 | | o 1: 112478962961 B | |
357 | |/ |
|
369 | |/ | |
358 | o 0: 426bada5c675 A |
|
370 | o 0: 426bada5c675 A | |
359 |
|
371 | |||
360 | Massively rewrite the DAG: |
|
372 | Massively rewrite the DAG: | |
361 |
|
373 | |||
362 | $ rebasewithdag -r 'all()' -d 'map(SRC, "A:I,I:null,H:A,B:J,J:C,C:H,D:E,F:G,G:K,K:D,E:B")' <<'EOS' |
|
374 | $ rebasewithdag -r 'all()' -d 'map(SRC, "A:I,I:null,H:A,B:J,J:C,C:H,D:E,F:G,G:K,K:D,E:B")' <<'EOS' | |
363 | > D G K |
|
375 | > D G K | |
364 | > | | | |
|
376 | > | | | | |
365 | > C F J |
|
377 | > C F J | |
366 | > | | | |
|
378 | > | | | | |
367 | > B E I |
|
379 | > B E I | |
368 | > \| | |
|
380 | > \| | | |
369 | > A H |
|
381 | > A H | |
370 | > EOS |
|
382 | > EOS | |
371 | rebasing 4:701514e1408d "I" (I) |
|
383 | rebasing 4:701514e1408d "I" (I) | |
372 | rebasing 0:426bada5c675 "A" (A) |
|
384 | rebasing 0:426bada5c675 "A" (A) | |
373 | rebasing 1:e7050b6e5048 "H" (H) |
|
385 | rebasing 1:e7050b6e5048 "H" (H) | |
374 | rebasing 5:26805aba1e60 "C" (C) |
|
386 | rebasing 5:26805aba1e60 "C" (C) | |
375 | rebasing 7:cf89f86b485b "J" (J) |
|
387 | rebasing 7:cf89f86b485b "J" (J) | |
376 | rebasing 2:112478962961 "B" (B) |
|
388 | rebasing 2:112478962961 "B" (B) | |
377 | rebasing 3:7fb047a69f22 "E" (E) |
|
389 | rebasing 3:7fb047a69f22 "E" (E) | |
378 | rebasing 8:f585351a92f8 "D" (D) |
|
390 | rebasing 8:f585351a92f8 "D" (D) | |
379 | rebasing 10:ae41898d7875 "K" (K tip) |
|
391 | rebasing 10:ae41898d7875 "K" (K tip) | |
380 | rebasing 9:711f53bbef0b "G" (G) |
|
392 | rebasing 9:711f53bbef0b "G" (G) | |
381 | rebasing 6:64a8289d2492 "F" (F) |
|
393 | rebasing 6:64a8289d2492 "F" (F) | |
382 | o 21: 3735afb3713a F |
|
394 | o 21: 3735afb3713a F | |
383 | | |
|
395 | | | |
384 | o 20: 07698142d7a7 G |
|
396 | o 20: 07698142d7a7 G | |
385 | | |
|
397 | | | |
386 | o 19: 33aba52e7e72 K |
|
398 | o 19: 33aba52e7e72 K | |
387 | | |
|
399 | | | |
388 | o 18: 9fdae89dc5a1 D |
|
400 | o 18: 9fdae89dc5a1 D | |
389 | | |
|
401 | | | |
390 | o 17: 277dda9a65ee E |
|
402 | o 17: 277dda9a65ee E | |
391 | | |
|
403 | | | |
392 | o 16: 9c74fd8657ad B |
|
404 | o 16: 9c74fd8657ad B | |
393 | | |
|
405 | | | |
394 | o 15: 6527eb0688bb J |
|
406 | o 15: 6527eb0688bb J | |
395 | | |
|
407 | | | |
396 | o 14: e94d655b928d C |
|
408 | o 14: e94d655b928d C | |
397 | | |
|
409 | | | |
398 | o 13: 620d6d349459 H |
|
410 | o 13: 620d6d349459 H | |
399 | | |
|
411 | | | |
400 | o 12: a569a116758f A |
|
412 | o 12: a569a116758f A | |
401 | | |
|
413 | | | |
402 | o 11: 2bf1302f5c18 I |
|
414 | o 11: 2bf1302f5c18 I | |
403 |
|
415 | |||
404 | Resolve instability: |
|
416 | Resolve instability: | |
405 |
|
417 | |||
406 | $ rebasewithdag <<'EOF' -r 'orphan()-obsolete()' -d 'max((successors(max(roots(ALLSRC) & ::SRC)^)-obsolete())::)' |
|
418 | $ rebasewithdag <<'EOF' -r 'orphan()-obsolete()' -d 'max((successors(max(roots(ALLSRC) & ::SRC)^)-obsolete())::)' | |
407 | > F2 |
|
419 | > F2 | |
408 | > | |
|
420 | > | | |
409 | > J E E2 |
|
421 | > J E E2 | |
410 | > | |/ |
|
422 | > | |/ | |
411 | > I2 I | E3 |
|
423 | > I2 I | E3 | |
412 | > \| |/ |
|
424 | > \| |/ | |
413 | > H | G |
|
425 | > H | G | |
414 | > | | | |
|
426 | > | | | | |
415 | > B2 D F |
|
427 | > B2 D F | |
416 | > | |/ # rebase: B -> B2 |
|
428 | > | |/ # rebase: B -> B2 | |
417 | > N C # amend: E -> E2 |
|
429 | > N C # amend: E -> E2 | |
418 | > | | # amend: E2 -> E3 |
|
430 | > | | # amend: E2 -> E3 | |
419 | > M B # rebase: F -> F2 |
|
431 | > M B # rebase: F -> F2 | |
420 | > \| # amend: I -> I2 |
|
432 | > \| # amend: I -> I2 | |
421 | > A |
|
433 | > A | |
422 | > EOF |
|
434 | > EOF | |
423 | 6 new orphan changesets |
|
435 | 6 new orphan changesets | |
424 | rebasing 16:5c432343bf59 "J" (J tip) |
|
436 | rebasing 16:5c432343bf59 "J" (J tip) | |
425 | rebasing 3:26805aba1e60 "C" (C) |
|
437 | rebasing 3:26805aba1e60 "C" (C) | |
426 | rebasing 6:f585351a92f8 "D" (D) |
|
438 | rebasing 6:f585351a92f8 "D" (D) | |
427 | rebasing 10:ffebc37c5d0b "E3" (E3) |
|
439 | rebasing 10:ffebc37c5d0b "E3" (E3) | |
428 | rebasing 13:fb184bcfeee8 "F2" (F2) |
|
440 | rebasing 13:fb184bcfeee8 "F2" (F2) | |
429 | rebasing 11:dc838ab4c0da "G" (G) |
|
441 | rebasing 11:dc838ab4c0da "G" (G) | |
430 | o 22: 174f63d574a8 G |
|
442 | o 22: 174f63d574a8 G | |
431 | | |
|
443 | | | |
432 | o 21: c9d9fbe76705 F2 |
|
444 | o 21: c9d9fbe76705 F2 | |
433 | | |
|
445 | | | |
434 | o 20: 0a03c2ede755 E3 |
|
446 | o 20: 0a03c2ede755 E3 | |
435 | | |
|
447 | | | |
436 | o 19: 228d9d2541b1 D |
|
448 | o 19: 228d9d2541b1 D | |
437 | | |
|
449 | | | |
438 | o 18: cd856b400c95 C |
|
450 | o 18: cd856b400c95 C | |
439 | | |
|
451 | | | |
440 | o 17: 9148200c858c J |
|
452 | o 17: 9148200c858c J | |
441 | | |
|
453 | | | |
442 | o 15: eb74780f5094 I2 |
|
454 | o 15: eb74780f5094 I2 | |
443 | | |
|
455 | | | |
444 | o 12: 78309edd643f H |
|
456 | o 12: 78309edd643f H | |
445 | | |
|
457 | | | |
446 | o 5: 4b4531bd8e1d B2 |
|
458 | o 5: 4b4531bd8e1d B2 | |
447 | | |
|
459 | | | |
448 | o 4: 337c285c272b N |
|
460 | o 4: 337c285c272b N | |
449 | | |
|
461 | | | |
450 | o 2: 699bc4b6fa22 M |
|
462 | o 2: 699bc4b6fa22 M | |
451 | | |
|
463 | | | |
452 | o 0: 426bada5c675 A |
|
464 | o 0: 426bada5c675 A | |
453 |
|
465 |
General Comments 0
You need to be logged in to leave comments.
Login now