##// END OF EJS Templates
rebase: extract final changesets cleanup logic in a dedicated function...
Pierre-Yves David -
r17611:910123ea default
parent child Browse files
Show More
@@ -310,15 +310,7 b' def rebase(ui, repo, **opts):'
310 nstate[repo[k].node()] = repo[v].node()
310 nstate[repo[k].node()] = repo[v].node()
311
311
312 if not keepf:
312 if not keepf:
313 # Remove no more useful revisions
313 clearrebased(ui, repo, state)
314 rebased = [rev for rev in state if state[rev] != nullmerge]
315 if rebased:
316 if set(repo.changelog.descendants([min(rebased)])) - set(state):
317 ui.warn(_("warning: new changesets detected "
318 "on source branch, not stripping\n"))
319 else:
320 # backup the old csets by default
321 repair.strip(ui, repo, repo[min(rebased)].node(), "all")
322
314
323 if currentbookmarks:
315 if currentbookmarks:
324 updatebookmarks(repo, nstate, currentbookmarks, **opts)
316 updatebookmarks(repo, nstate, currentbookmarks, **opts)
@@ -664,6 +656,18 b' def buildstate(repo, dest, rebaseset, co'
664 state.update(dict.fromkeys(detachset, nullmerge))
656 state.update(dict.fromkeys(detachset, nullmerge))
665 return repo['.'].rev(), dest.rev(), state
657 return repo['.'].rev(), dest.rev(), state
666
658
659 def clearrebased(ui, repo, state):
660 """dispose of rebased revision at the end of the rebase"""
661 rebased = [rev for rev in state if state[rev] != nullmerge]
662 if rebased:
663 if set(repo.changelog.descendants([min(rebased)])) - set(state):
664 ui.warn(_("warning: new changesets detected "
665 "on source branch, not stripping\n"))
666 else:
667 # backup the old csets by default
668 repair.strip(ui, repo, repo[min(rebased)].node(), "all")
669
670
667 def pullrebase(orig, ui, repo, *args, **opts):
671 def pullrebase(orig, ui, repo, *args, **opts):
668 'Call rebase after pull if the latter has been invoked with --rebase'
672 'Call rebase after pull if the latter has been invoked with --rebase'
669 if opts.get('rebase'):
673 if opts.get('rebase'):
General Comments 0
You need to be logged in to leave comments. Login now