##// END OF EJS Templates
rebase: move local variable 'targetancestors' to the RR class
Kostia Balytskyi -
r29361:8a080fab default
parent child Browse files
Show More
@@ -131,6 +131,7 b' class rebaseruntime(object):'
131 self.activebookmark = None
131 self.activebookmark = None
132 self.target = None
132 self.target = None
133 self.skipped = set()
133 self.skipped = set()
134 self.targetancestors = set()
134
135
135 @command('rebase',
136 @command('rebase',
136 [('s', 'source', '',
137 [('s', 'source', '',
@@ -243,8 +244,6 b' def rebase(ui, repo, **opts):'
243
244
244 """
245 """
245 rbsrt = rebaseruntime()
246 rbsrt = rebaseruntime()
246 targetancestors = set()
247
248
247
249 lock = wlock = None
248 lock = wlock = None
250 try:
249 try:
@@ -377,10 +376,10 b' def rebase(ui, repo, **opts):'
377
376
378 (rbsrt.originalwd, rbsrt.target, rbsrt.state) = result
377 (rbsrt.originalwd, rbsrt.target, rbsrt.state) = result
379 if collapsef:
378 if collapsef:
380 targetancestors = repo.changelog.ancestors([rbsrt.target],
379 rbsrt.targetancestors = repo.changelog.ancestors([rbsrt.target],
381 inclusive=True)
380 inclusive=True)
382 rbsrt.external = externalparent(repo, rbsrt.state,
381 rbsrt.external = externalparent(repo, rbsrt.state,
383 targetancestors)
382 rbsrt.targetancestors)
384
383
385 if dest.closesbranch() and not keepbranchesf:
384 if dest.closesbranch() and not keepbranchesf:
386 ui.status(_('reopening closed branch head %s\n') % dest)
385 ui.status(_('reopening closed branch head %s\n') % dest)
@@ -399,9 +398,9 b' def rebase(ui, repo, **opts):'
399 'branches'))
398 'branches'))
400
399
401 # Rebase
400 # Rebase
402 if not targetancestors:
401 if not rbsrt.targetancestors:
403 targetancestors = repo.changelog.ancestors([rbsrt.target],
402 rbsrt.targetancestors = repo.changelog.ancestors([rbsrt.target],
404 inclusive=True)
403 inclusive=True)
405
404
406 # Keep track of the current bookmarks in order to reset them later
405 # Keep track of the current bookmarks in order to reset them later
407 currentbookmarks = repo._bookmarks.copy()
406 currentbookmarks = repo._bookmarks.copy()
@@ -428,7 +427,7 b' def rebase(ui, repo, **opts):'
428 _('changesets'), total)
427 _('changesets'), total)
429 p1, p2, base = defineparents(repo, rev, rbsrt.target,
428 p1, p2, base = defineparents(repo, rev, rbsrt.target,
430 rbsrt.state,
429 rbsrt.state,
431 targetancestors,
430 rbsrt.targetancestors,
432 obsoletenotrebased)
431 obsoletenotrebased)
433 storestatus(repo, rbsrt.originalwd, rbsrt.target,
432 storestatus(repo, rbsrt.originalwd, rbsrt.target,
434 rbsrt.state, collapsef, keepf, keepbranchesf,
433 rbsrt.state, collapsef, keepf, keepbranchesf,
@@ -496,7 +495,8 b' def rebase(ui, repo, **opts):'
496 if collapsef and not keepopen:
495 if collapsef and not keepopen:
497 p1, p2, _base = defineparents(repo, min(rbsrt.state),
496 p1, p2, _base = defineparents(repo, min(rbsrt.state),
498 rbsrt.target, rbsrt.state,
497 rbsrt.target, rbsrt.state,
499 targetancestors, obsoletenotrebased)
498 rbsrt.targetancestors,
499 obsoletenotrebased)
500 editopt = opts.get('edit')
500 editopt = opts.get('edit')
501 editform = 'rebase.collapse'
501 editform = 'rebase.collapse'
502 if collapsemsg:
502 if collapsemsg:
General Comments 0
You need to be logged in to leave comments. Login now