Show More
@@ -129,6 +129,7 class rebaseruntime(object): | |||||
129 | # dict will be what contains most of the rebase progress state. |
|
129 | # dict will be what contains most of the rebase progress state. | |
130 | self.state = {} |
|
130 | self.state = {} | |
131 | self.activebookmark = None |
|
131 | self.activebookmark = None | |
|
132 | self.target = None | |||
132 |
|
133 | |||
133 | @command('rebase', |
|
134 | @command('rebase', | |
134 | [('s', 'source', '', |
|
135 | [('s', 'source', '', | |
@@ -241,7 +242,6 def rebase(ui, repo, **opts): | |||||
241 |
|
242 | |||
242 | """ |
|
243 | """ | |
243 | rbsrt = rebaseruntime() |
|
244 | rbsrt = rebaseruntime() | |
244 | target = None |
|
|||
245 | skipped = set() |
|
245 | skipped = set() | |
246 | targetancestors = set() |
|
246 | targetancestors = set() | |
247 |
|
247 | |||
@@ -302,7 +302,7 def rebase(ui, repo, **opts): | |||||
302 | ui.warn(_('tool option will be ignored\n')) |
|
302 | ui.warn(_('tool option will be ignored\n')) | |
303 |
|
303 | |||
304 | try: |
|
304 | try: | |
305 | (rbsrt.originalwd, target, rbsrt.state, skipped, |
|
305 | (rbsrt.originalwd, rbsrt.target, rbsrt.state, skipped, | |
306 | collapsef, keepf, keepbranchesf, rbsrt.external, |
|
306 | collapsef, keepf, keepbranchesf, rbsrt.external, | |
307 | rbsrt.activebookmark) = restorestatus(repo) |
|
307 | rbsrt.activebookmark) = restorestatus(repo) | |
308 | collapsemsg = restorecollapsemsg(repo) |
|
308 | collapsemsg = restorecollapsemsg(repo) | |
@@ -318,7 +318,8 def rebase(ui, repo, **opts): | |||||
318 | hint = _('use "hg rebase --abort" to clear broken state') |
|
318 | hint = _('use "hg rebase --abort" to clear broken state') | |
319 | raise error.Abort(msg, hint=hint) |
|
319 | raise error.Abort(msg, hint=hint) | |
320 | if abortf: |
|
320 | if abortf: | |
321 |
return abort(repo, rbsrt.originalwd, target, |
|
321 | return abort(repo, rbsrt.originalwd, rbsrt.target, | |
|
322 | rbsrt.state, | |||
322 | activebookmark=rbsrt.activebookmark) |
|
323 | activebookmark=rbsrt.activebookmark) | |
323 |
|
324 | |||
324 | obsoletenotrebased = {} |
|
325 | obsoletenotrebased = {} | |
@@ -328,7 +329,7 def rebase(ui, repo, **opts): | |||||
328 | if st == revprecursor]) |
|
329 | if st == revprecursor]) | |
329 | rebasesetrevs = set(rbsrt.state.keys()) |
|
330 | rebasesetrevs = set(rbsrt.state.keys()) | |
330 | obsoletenotrebased = _computeobsoletenotrebased(repo, |
|
331 | obsoletenotrebased = _computeobsoletenotrebased(repo, | |
331 | rebaseobsrevs, target) |
|
332 | rebaseobsrevs, rbsrt.target) | |
332 | rebaseobsskipped = set(obsoletenotrebased) |
|
333 | rebaseobsskipped = set(obsoletenotrebased) | |
333 | _checkobsrebase(repo, ui, rebaseobsrevs, rebasesetrevs, |
|
334 | _checkobsrebase(repo, ui, rebaseobsrevs, rebasesetrevs, | |
334 | rebaseobsskipped) |
|
335 | rebaseobsskipped) | |
@@ -374,9 +375,9 def rebase(ui, repo, **opts): | |||||
374 | % repo[root], |
|
375 | % repo[root], | |
375 | hint=_('see "hg help phases" for details')) |
|
376 | hint=_('see "hg help phases" for details')) | |
376 |
|
377 | |||
377 | (rbsrt.originalwd, target, rbsrt.state) = result |
|
378 | (rbsrt.originalwd, rbsrt.target, rbsrt.state) = result | |
378 | if collapsef: |
|
379 | if collapsef: | |
379 | targetancestors = repo.changelog.ancestors([target], |
|
380 | targetancestors = repo.changelog.ancestors([rbsrt.target], | |
380 | inclusive=True) |
|
381 | inclusive=True) | |
381 | rbsrt.external = externalparent(repo, rbsrt.state, |
|
382 | rbsrt.external = externalparent(repo, rbsrt.state, | |
382 | targetancestors) |
|
383 | targetancestors) | |
@@ -399,7 +400,8 def rebase(ui, repo, **opts): | |||||
399 |
|
400 | |||
400 | # Rebase |
|
401 | # Rebase | |
401 | if not targetancestors: |
|
402 | if not targetancestors: | |
402 |
targetancestors = repo.changelog.ancestors([target], |
|
403 | targetancestors = repo.changelog.ancestors([rbsrt.target], | |
|
404 | inclusive=True) | |||
403 |
|
405 | |||
404 | # Keep track of the current bookmarks in order to reset them later |
|
406 | # Keep track of the current bookmarks in order to reset them later | |
405 | currentbookmarks = repo._bookmarks.copy() |
|
407 | currentbookmarks = repo._bookmarks.copy() | |
@@ -424,11 +426,12 def rebase(ui, repo, **opts): | |||||
424 | ui.status(_('rebasing %s\n') % desc) |
|
426 | ui.status(_('rebasing %s\n') % desc) | |
425 | ui.progress(_("rebasing"), pos, ("%d:%s" % (rev, ctx)), |
|
427 | ui.progress(_("rebasing"), pos, ("%d:%s" % (rev, ctx)), | |
426 | _('changesets'), total) |
|
428 | _('changesets'), total) | |
427 |
p1, p2, base = defineparents(repo, rev, target, |
|
429 | p1, p2, base = defineparents(repo, rev, rbsrt.target, | |
|
430 | rbsrt.state, | |||
428 | targetancestors, |
|
431 | targetancestors, | |
429 | obsoletenotrebased) |
|
432 | obsoletenotrebased) | |
430 |
storestatus(repo, rbsrt.originalwd, target, |
|
433 | storestatus(repo, rbsrt.originalwd, rbsrt.target, | |
431 | collapsef, keepf, keepbranchesf, |
|
434 | rbsrt.state, collapsef, keepf, keepbranchesf, | |
432 | rbsrt.external, rbsrt.activebookmark) |
|
435 | rbsrt.external, rbsrt.activebookmark) | |
433 | storecollapsemsg(repo, collapsemsg) |
|
436 | storecollapsemsg(repo, collapsemsg) | |
434 | if len(repo[None].parents()) == 2: |
|
437 | if len(repo[None].parents()) == 2: | |
@@ -438,7 +441,7 def rebase(ui, repo, **opts): | |||||
438 | ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), |
|
441 | ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), | |
439 | 'rebase') |
|
442 | 'rebase') | |
440 | stats = rebasenode(repo, rev, p1, base, rbsrt.state, |
|
443 | stats = rebasenode(repo, rev, p1, base, rbsrt.state, | |
441 | collapsef, target) |
|
444 | collapsef, rbsrt.target) | |
442 | if stats and stats[3] > 0: |
|
445 | if stats and stats[3] > 0: | |
443 | raise error.InterventionRequired( |
|
446 | raise error.InterventionRequired( | |
444 | _('unresolved conflicts (see hg ' |
|
447 | _('unresolved conflicts (see hg ' | |
@@ -491,9 +494,9 def rebase(ui, repo, **opts): | |||||
491 | ui.note(_('rebase merging completed\n')) |
|
494 | ui.note(_('rebase merging completed\n')) | |
492 |
|
495 | |||
493 | if collapsef and not keepopen: |
|
496 | if collapsef and not keepopen: | |
494 |
p1, p2, _base = defineparents(repo, min(rbsrt.state), |
|
497 | p1, p2, _base = defineparents(repo, min(rbsrt.state), | |
495 |
rbsrt.state, |
|
498 | rbsrt.target, rbsrt.state, | |
496 | obsoletenotrebased) |
|
499 | targetancestors, obsoletenotrebased) | |
497 | editopt = opts.get('edit') |
|
500 | editopt = opts.get('edit') | |
498 | editform = 'rebase.collapse' |
|
501 | editform = 'rebase.collapse' | |
499 | if collapsemsg: |
|
502 | if collapsemsg: | |
@@ -512,7 +515,7 def rebase(ui, repo, **opts): | |||||
512 | keepbranches=keepbranchesf, |
|
515 | keepbranches=keepbranchesf, | |
513 | date=date) |
|
516 | date=date) | |
514 | if newnode is None: |
|
517 | if newnode is None: | |
515 | newrev = target |
|
518 | newrev = rbsrt.target | |
516 | else: |
|
519 | else: | |
517 | newrev = repo[newnode].rev() |
|
520 | newrev = repo[newnode].rev() | |
518 | for oldrev in rbsrt.state.iterkeys(): |
|
521 | for oldrev in rbsrt.state.iterkeys(): | |
@@ -530,7 +533,7 def rebase(ui, repo, **opts): | |||||
530 | nstate[repo[k].node()] = repo[v].node() |
|
533 | nstate[repo[k].node()] = repo[v].node() | |
531 | # XXX this is the same as dest.node() for the non-continue path -- |
|
534 | # XXX this is the same as dest.node() for the non-continue path -- | |
532 | # this should probably be cleaned up |
|
535 | # this should probably be cleaned up | |
533 | targetnode = repo[target].node() |
|
536 | targetnode = repo[rbsrt.target].node() | |
534 |
|
537 | |||
535 | # restore original working directory |
|
538 | # restore original working directory | |
536 | # (we do this before stripping) |
|
539 | # (we do this before stripping) |
General Comments 0
You need to be logged in to leave comments.
Login now