Show More
@@ -205,8 +205,8 b' class rebaseruntime(object):' | |||
|
205 | 205 | self.skipemptysuccessorf = rewriteutil.skip_empty_successor( |
|
206 | 206 | repo.ui, b'rebase' |
|
207 | 207 | ) |
|
208 |
self.obsolete |
|
|
209 |
self.obsolete |
|
|
208 | self.obsolete_with_successor_in_destination = {} | |
|
209 | self.obsolete_with_successor_in_rebase_set = set() | |
|
210 | 210 | self.inmemory = inmemory |
|
211 | 211 | self.dryrun = dryrun |
|
212 | 212 | self.stateobj = statemod.cmdstate(repo, b'rebasestate') |
@@ -350,16 +350,16 b' class rebaseruntime(object):' | |||
|
350 | 350 | |
|
351 | 351 | def _handleskippingobsolete(self): |
|
352 | 352 | """Compute structures necessary for skipping obsolete revisions""" |
|
353 |
self.obsolete |
|
|
353 | self.obsolete_with_successor_in_destination = {} | |
|
354 | 354 | if not self.ui.configbool(b'experimental', b'rebaseskipobsolete'): |
|
355 | 355 | return |
|
356 | 356 | obsoleteset = {r for r in self.state if self.repo[r].obsolete()} |
|
357 | 357 | ( |
|
358 |
self.obsolete |
|
|
359 |
self.obsolete |
|
|
360 |
) = _computeobsolete |
|
|
361 |
skippedset = set(self.obsolete |
|
|
362 |
skippedset.update(self.obsolete |
|
|
358 | self.obsolete_with_successor_in_destination, | |
|
359 | self.obsolete_with_successor_in_rebase_set, | |
|
360 | ) = _compute_obsolete_sets(self.repo, obsoleteset, self.destmap) | |
|
361 | skippedset = set(self.obsolete_with_successor_in_destination) | |
|
362 | skippedset.update(self.obsolete_with_successor_in_rebase_set) | |
|
363 | 363 | _checkobsrebase(self.repo, self.ui, obsoleteset, skippedset) |
|
364 | 364 | |
|
365 | 365 | def _prepareabortorcontinue( |
@@ -368,7 +368,7 b' class rebaseruntime(object):' | |||
|
368 | 368 | self.resume = True |
|
369 | 369 | try: |
|
370 | 370 | self.restorestatus() |
|
371 |
# Calculate self.obsolete |
|
|
371 | # Calculate self.obsolete_* sets | |
|
372 | 372 | self._handleskippingobsolete() |
|
373 | 373 | self.collapsemsg = restorecollapsemsg(self.repo, isabort) |
|
374 | 374 | except error.RepoLookupError: |
@@ -436,7 +436,7 b' class rebaseruntime(object):' | |||
|
436 | 436 | |
|
437 | 437 | self.prepared = True |
|
438 | 438 | |
|
439 |
# Calculate self.obsolete |
|
|
439 | # Calculate self.obsolete_* sets | |
|
440 | 440 | self._handleskippingobsolete() |
|
441 | 441 | |
|
442 | 442 | def _assignworkingcopy(self): |
@@ -501,8 +501,8 b' class rebaseruntime(object):' | |||
|
501 | 501 | if not allowdivergence: |
|
502 | 502 | sortedrevs -= self.repo.revs( |
|
503 | 503 | b'descendants(%ld) and not %ld', |
|
504 |
self.obsolete |
|
|
505 |
self.obsolete |
|
|
504 | self.obsolete_with_successor_in_rebase_set, | |
|
505 | self.obsolete_with_successor_in_rebase_set, | |
|
506 | 506 | ) |
|
507 | 507 | for rev in sortedrevs: |
|
508 | 508 | self._rebasenode(tr, rev, allowdivergence, progress) |
@@ -575,7 +575,7 b' class rebaseruntime(object):' | |||
|
575 | 575 | ui.status(_(b'already rebased %s\n') % desc) |
|
576 | 576 | elif ( |
|
577 | 577 | not allowdivergence |
|
578 |
and rev in self.obsolete |
|
|
578 | and rev in self.obsolete_with_successor_in_rebase_set | |
|
579 | 579 | ): |
|
580 | 580 | msg = ( |
|
581 | 581 | _( |
@@ -586,8 +586,8 b' class rebaseruntime(object):' | |||
|
586 | 586 | ) |
|
587 | 587 | repo.ui.status(msg) |
|
588 | 588 | self.skipped.add(rev) |
|
589 |
elif rev in self.obsolete |
|
|
590 |
succ = self.obsolete |
|
|
589 | elif rev in self.obsolete_with_successor_in_destination: | |
|
590 | succ = self.obsolete_with_successor_in_destination[rev] | |
|
591 | 591 | if succ is None: |
|
592 | 592 | msg = _(b'note: not rebasing %s, it has no successor\n') % desc |
|
593 | 593 | else: |
@@ -613,7 +613,7 b' class rebaseruntime(object):' | |||
|
613 | 613 | self.destmap, |
|
614 | 614 | self.state, |
|
615 | 615 | self.skipped, |
|
616 |
self.obsolete |
|
|
616 | self.obsolete_with_successor_in_destination, | |
|
617 | 617 | ) |
|
618 | 618 | if self.resume and self.wctx.p1().rev() == p1: |
|
619 | 619 | repo.ui.debug(b'resuming interrupted rebase\n') |
@@ -725,7 +725,7 b' class rebaseruntime(object):' | |||
|
725 | 725 | self.destmap, |
|
726 | 726 | self.state, |
|
727 | 727 | self.skipped, |
|
728 |
self.obsolete |
|
|
728 | self.obsolete_with_successor_in_destination, | |
|
729 | 729 | ) |
|
730 | 730 | editopt = opts.get(b'edit') |
|
731 | 731 | editform = b'rebase.collapse' |
@@ -2179,17 +2179,17 b' def pullrebase(orig, ui, repo, *args, **' | |||
|
2179 | 2179 | return ret |
|
2180 | 2180 | |
|
2181 | 2181 | |
|
2182 |
def _computeobsolete |
|
|
2183 | """Return (obsoletenotrebased, obsoletewithoutsuccessorindestination). | |
|
2182 | def _compute_obsolete_sets(repo, rebaseobsrevs, destmap): | |
|
2183 | """Figure out what to do about about obsolete revisions | |
|
2184 | 2184 | |
|
2185 |
`obsolete |
|
|
2185 | `obsolete_with_successor_in_destination` is a mapping mapping obsolete => successor for all | |
|
2186 | 2186 | obsolete nodes to be rebased given in `rebaseobsrevs`. |
|
2187 | 2187 | |
|
2188 |
`obsolete |
|
|
2189 | without a successor in destination. | |
|
2188 | `obsolete_with_successor_in_rebase_set` is a set with obsolete revisions, | |
|
2189 | without a successor in destination, that would cause divergence. | |
|
2190 | 2190 | """ |
|
2191 | obsoletenotrebased = {} | |
|
2192 |
obsolete |
|
|
2191 | obsolete_with_successor_in_destination = {} | |
|
2192 | obsolete_with_successor_in_rebase_set = set() | |
|
2193 | 2193 | |
|
2194 | 2194 | assert repo.filtername is None |
|
2195 | 2195 | cl = repo.changelog |
@@ -2205,21 +2205,24 b' def _computeobsoletenotrebased(repo, reb' | |||
|
2205 | 2205 | succrevs.discard(None) |
|
2206 | 2206 | if not successors or succrevs.issubset(extinctrevs): |
|
2207 | 2207 | # no successor, or all successors are extinct |
|
2208 |
obsolete |
|
|
2208 | obsolete_with_successor_in_destination[srcrev] = None | |
|
2209 | 2209 | else: |
|
2210 | 2210 | dstrev = destmap[srcrev] |
|
2211 | 2211 | for succrev in succrevs: |
|
2212 | 2212 | if cl.isancestorrev(succrev, dstrev): |
|
2213 |
obsolete |
|
|
2213 | obsolete_with_successor_in_destination[srcrev] = succrev | |
|
2214 | 2214 | break |
|
2215 | 2215 | else: |
|
2216 | 2216 | # If 'srcrev' has a successor in rebase set but none in |
|
2217 | 2217 | # destination (which would be catched above), we shall skip it |
|
2218 | 2218 | # and its descendants to avoid divergence. |
|
2219 | 2219 | if srcrev in extinctrevs or any(s in destmap for s in succrevs): |
|
2220 |
obsolete |
|
|
2220 | obsolete_with_successor_in_rebase_set.add(srcrev) | |
|
2221 | 2221 | |
|
2222 | return obsoletenotrebased, obsoletewithoutsuccessorindestination | |
|
2222 | return ( | |
|
2223 | obsolete_with_successor_in_destination, | |
|
2224 | obsolete_with_successor_in_rebase_set, | |
|
2225 | ) | |
|
2223 | 2226 | |
|
2224 | 2227 | |
|
2225 | 2228 | def abortrebase(ui, repo): |
General Comments 0
You need to be logged in to leave comments.
Login now