##// END OF EJS Templates
rebase: do not invent successor to skipped changeset...
Pierre-Yves David -
r18444:55aff0c2 default
parent child Browse files
Show More
@@ -312,7 +312,7 b' def rebase(ui, repo, **opts):'
312 312 collapsedas = None
313 313 if collapsef:
314 314 collapsedas = newrev
315 clearrebased(ui, repo, state, collapsedas)
315 clearrebased(ui, repo, state, skipped, collapsedas)
316 316
317 317 if currentbookmarks:
318 318 updatebookmarks(repo, nstate, currentbookmarks, **opts)
@@ -660,7 +660,7 b' def buildstate(repo, dest, rebaseset, co'
660 660 state[r] = nullmerge
661 661 return repo['.'].rev(), dest.rev(), state
662 662
663 def clearrebased(ui, repo, state, collapsedas=None):
663 def clearrebased(ui, repo, state, skipped, collapsedas=None):
664 664 """dispose of rebased revision at the end of the rebase
665 665
666 666 If `collapsedas` is not None, the rebase was a collapse whose result if the
@@ -669,9 +669,13 b' def clearrebased(ui, repo, state, collap'
669 669 markers = []
670 670 for rev, newrev in sorted(state.items()):
671 671 if newrev >= 0:
672 if collapsedas is not None:
673 newrev = collapsedas
674 markers.append((repo[rev], (repo[newrev],)))
672 if rev in skipped:
673 succs = ()
674 elif collapsedas is not None:
675 succs = (repo[collapsedas],)
676 else:
677 succs = (repo[newrev],)
678 markers.append((repo[rev], succs))
675 679 if markers:
676 680 obsolete.createmarkers(repo, markers)
677 681 else:
@@ -166,10 +166,65 b' set.'
166 166 o 0:cd010b8cd998 A
167 167
168 168 $ hg debugobsolete
169 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 08483444fef91d6224f6655ee586a65d263ad34c 0 {'date': '*', 'user': 'test'} (glob)
169 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {'date': '*', 'user': 'test'} (glob)
170 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 {'date': '*', 'user': 'test'} (glob)
171 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {'date': '*', 'user': 'test'} (glob)
172
173
174 More complex case were part of the rebase set were already rebased
175
176 $ hg rebase --rev 'desc(D)' --dest 'desc(H)'
177 $ hg debugobsolete
178 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {'date': '*', 'user': 'test'} (glob)
170 179 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 {'date': '*', 'user': 'test'} (glob)
171 32af7686d403cf45b5d95f2d70cebea587ac806a 5ae4c968c6aca831df823664e706c9d4aa34473d 0 {'date': '*', 'user': 'test'} (glob)
172
180 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {'date': '*', 'user': 'test'} (glob)
181 08483444fef91d6224f6655ee586a65d263ad34c cbc07f26687521cecfc9a141bf5ecfc0fd2b8531 0 {'date': '* *', 'user': 'test'} (glob)
182 $ hg log -G
183 @ 11:cbc07f266875 D
184 |
185 | o 10:5ae4c968c6ac C
186 | |
187 | x 9:08483444fef9 D
188 | |
189 | o 8:8877864f1edb B
190 | |
191 o | 7:02de42196ebe H
192 | |
193 | o 6:eea13746799a G
194 |/|
195 o | 5:24b6387c8c8c F
196 | |
197 | o 4:9520eea781bc E
198 |/
199 o 0:cd010b8cd998 A
200
201 $ hg rebase --source 'desc(B)' --dest 'tip'
202 $ hg debugobsolete
203 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {'date': '* *', 'user': 'test'} (glob)
204 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 {'date': '* *', 'user': 'test'} (glob)
205 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {'date': '* *', 'user': 'test'} (glob)
206 08483444fef91d6224f6655ee586a65d263ad34c cbc07f26687521cecfc9a141bf5ecfc0fd2b8531 0 {'date': '* *', 'user': 'test'} (glob)
207 8877864f1edb05d0e07dc4ba77b67a80a7b86672 b1861c79d66ec3aa1b607ac3c9fb819e38b12238 0 {'date': '* *', 'user': 'test'} (glob)
208 08483444fef91d6224f6655ee586a65d263ad34c 0 {'date': '* *', 'user': 'test'} (glob)
209 5ae4c968c6aca831df823664e706c9d4aa34473d dd4be135457a404ce5541de427ae1d98a28f4acd 0 {'date': '* *', 'user': 'test'} (glob)
210 $ hg log --rev 'divergent()'
211 $ hg log -G
212 @ 13:dd4be135457a C
213 |
214 o 12:b1861c79d66e B
215 |
216 o 11:cbc07f266875 D
217 |
218 o 7:02de42196ebe H
219 |
220 | o 6:eea13746799a G
221 |/|
222 o | 5:24b6387c8c8c F
223 | |
224 | o 4:9520eea781bc E
225 |/
226 o 0:cd010b8cd998 A
227
173 228
174 229 $ cd ..
175 230
@@ -329,3 +384,4 b' Test multiple root handling'
329 384 |/
330 385 o 0:cd010b8cd998 A
331 386
387 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now