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