Show More
@@ -229,6 +229,24 b' class rebaseruntime(object):' | |||||
229 | self.external = external |
|
229 | self.external = external | |
230 | self.activebookmark = activebookmark |
|
230 | self.activebookmark = activebookmark | |
231 |
|
231 | |||
|
232 | def _handleskippingobsolete(self, rebaserevs, obsoleterevs, target): | |||
|
233 | """Compute structures necessary for skipping obsolete revisions | |||
|
234 | ||||
|
235 | rebaserevs: iterable of all revisions that are to be rebased | |||
|
236 | obsoleterevs: iterable of all obsolete revisions in rebaseset | |||
|
237 | target: a destination revision for the rebase operation | |||
|
238 | """ | |||
|
239 | self.obsoletenotrebased = {} | |||
|
240 | if not self.ui.configbool('experimental', 'rebaseskipobsolete', | |||
|
241 | default=True): | |||
|
242 | return | |||
|
243 | rebaseset = set(rebaserevs) | |||
|
244 | obsoleteset = set(obsoleterevs) | |||
|
245 | self.obsoletenotrebased = _computeobsoletenotrebased(self.repo, | |||
|
246 | obsoleteset, target) | |||
|
247 | skippedset = set(self.obsoletenotrebased) | |||
|
248 | _checkobsrebase(self.repo, self.ui, obsoleteset, rebaseset, skippedset) | |||
|
249 | ||||
232 | def _prepareabortorcontinue(self, isabort): |
|
250 | def _prepareabortorcontinue(self, isabort): | |
233 | try: |
|
251 | try: | |
234 | self.restorestatus() |
|
252 | self.restorestatus() | |
@@ -248,17 +266,8 b' class rebaseruntime(object):' | |||||
248 | return abort(self.repo, self.originalwd, self.target, |
|
266 | return abort(self.repo, self.originalwd, self.target, | |
249 | self.state, activebookmark=self.activebookmark) |
|
267 | self.state, activebookmark=self.activebookmark) | |
250 |
|
268 | |||
251 | self.obsoletenotrebased = {} |
|
269 | obsrevs = (r for r, st in self.state.items() if st == revprecursor) | |
252 | if self.ui.configbool('experimental', 'rebaseskipobsolete', |
|
270 | self._handleskippingobsolete(self.state.keys(), obsrevs, self.target) | |
253 | default=True): |
|
|||
254 | rebaseobsrevs = set([r for r, st in self.state.items() |
|
|||
255 | if st == revprecursor]) |
|
|||
256 | rebasesetrevs = set(self.state.keys()) |
|
|||
257 | self.obsoletenotrebased = _computeobsoletenotrebased(self.repo, |
|
|||
258 | rebaseobsrevs, self.target) |
|
|||
259 | rebaseobsskipped = set(self.obsoletenotrebased) |
|
|||
260 | _checkobsrebase(self.repo, self.ui, rebaseobsrevs, rebasesetrevs, |
|
|||
261 | rebaseobsskipped) |
|
|||
262 |
|
271 | |||
263 | def _preparenewrebase(self, dest, rebaseset): |
|
272 | def _preparenewrebase(self, dest, rebaseset): | |
264 | if dest is None: |
|
273 | if dest is None: | |
@@ -273,18 +282,8 b' class rebaseruntime(object):' | |||||
273 | " unrebased descendants"), |
|
282 | " unrebased descendants"), | |
274 | hint=_('use --keep to keep original changesets')) |
|
283 | hint=_('use --keep to keep original changesets')) | |
275 |
|
284 | |||
276 | self.obsoletenotrebased = {} |
|
285 | obsrevs = _filterobsoleterevs(self.repo, rebaseset) | |
277 | if self.ui.configbool('experimental', 'rebaseskipobsolete', |
|
286 | self._handleskippingobsolete(rebaseset, obsrevs, dest) | |
278 | default=True): |
|
|||
279 | rebasesetrevs = set(rebaseset) |
|
|||
280 | rebaseobsrevs = _filterobsoleterevs(self.repo, rebasesetrevs) |
|
|||
281 | self.obsoletenotrebased = _computeobsoletenotrebased(self.repo, |
|
|||
282 | rebaseobsrevs, |
|
|||
283 | dest) |
|
|||
284 | rebaseobsskipped = set(self.obsoletenotrebased) |
|
|||
285 | _checkobsrebase(self.repo, self.ui, rebaseobsrevs, |
|
|||
286 | rebasesetrevs, |
|
|||
287 | rebaseobsskipped) |
|
|||
288 |
|
287 | |||
289 | result = buildstate(self.repo, dest, rebaseset, self.collapsef, |
|
288 | result = buildstate(self.repo, dest, rebaseset, self.collapsef, | |
290 | self.obsoletenotrebased) |
|
289 | self.obsoletenotrebased) |
General Comments 0
You need to be logged in to leave comments.
Login now