##// END OF EJS Templates
rebase: move local variable 'skipped' to the RR class
Kostia Balytskyi -
r29360:4cbe62ab default
parent child Browse files
Show More
@@ -130,6 +130,7 b' class rebaseruntime(object):'
130 self.state = {}
130 self.state = {}
131 self.activebookmark = None
131 self.activebookmark = None
132 self.target = None
132 self.target = None
133 self.skipped = set()
133
134
134 @command('rebase',
135 @command('rebase',
135 [('s', 'source', '',
136 [('s', 'source', '',
@@ -242,7 +243,6 b' def rebase(ui, repo, **opts):'
242
243
243 """
244 """
244 rbsrt = rebaseruntime()
245 rbsrt = rebaseruntime()
245 skipped = set()
246 targetancestors = set()
246 targetancestors = set()
247
247
248
248
@@ -302,9 +302,9 b' 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, rbsrt.target, rbsrt.state, skipped,
305 (rbsrt.originalwd, rbsrt.target, rbsrt.state,
306 collapsef, keepf, keepbranchesf, rbsrt.external,
306 rbsrt.skipped, collapsef, keepf, keepbranchesf,
307 rbsrt.activebookmark) = restorestatus(repo)
307 rbsrt.external, rbsrt.activebookmark) = restorestatus(repo)
308 collapsemsg = restorecollapsemsg(repo)
308 collapsemsg = restorecollapsemsg(repo)
309 except error.RepoLookupError:
309 except error.RepoLookupError:
310 if abortf:
310 if abortf:
@@ -470,7 +470,7 b' def rebase(ui, repo, **opts):'
470 if not collapsef:
470 if not collapsef:
471 ui.warn(_('note: rebase of %d:%s created no changes '
471 ui.warn(_('note: rebase of %d:%s created no changes '
472 'to commit\n') % (rev, ctx))
472 'to commit\n') % (rev, ctx))
473 skipped.add(rev)
473 rbsrt.skipped.add(rev)
474 rbsrt.state[rev] = p1
474 rbsrt.state[rev] = p1
475 ui.debug('next revision set to %s\n' % p1)
475 ui.debug('next revision set to %s\n' % p1)
476 elif rbsrt.state[rev] == nullmerge:
476 elif rbsrt.state[rev] == nullmerge:
@@ -504,7 +504,7 b' def rebase(ui, repo, **opts):'
504 else:
504 else:
505 commitmsg = 'Collapsed revision'
505 commitmsg = 'Collapsed revision'
506 for rebased in rbsrt.state:
506 for rebased in rbsrt.state:
507 if rebased not in skipped and\
507 if rebased not in rbsrt.skipped and\
508 rbsrt.state[rebased] > nullmerge:
508 rbsrt.state[rebased] > nullmerge:
509 commitmsg += '\n* %s' % repo[rebased].description()
509 commitmsg += '\n* %s' % repo[rebased].description()
510 editopt = True
510 editopt = True
@@ -523,7 +523,7 b' def rebase(ui, repo, **opts):'
523 rbsrt.state[oldrev] = newrev
523 rbsrt.state[oldrev] = newrev
524
524
525 if 'qtip' in repo.tags():
525 if 'qtip' in repo.tags():
526 updatemq(repo, rbsrt.state, skipped, **opts)
526 updatemq(repo, rbsrt.state, rbsrt.skipped, **opts)
527
527
528 if currentbookmarks:
528 if currentbookmarks:
529 # Nodeids are needed to reset bookmarks
529 # Nodeids are needed to reset bookmarks
@@ -549,7 +549,7 b' def rebase(ui, repo, **opts):'
549 collapsedas = None
549 collapsedas = None
550 if collapsef:
550 if collapsef:
551 collapsedas = newnode
551 collapsedas = newnode
552 clearrebased(ui, repo, rbsrt.state, skipped, collapsedas)
552 clearrebased(ui, repo, rbsrt.state, rbsrt.skipped, collapsedas)
553
553
554 with repo.transaction('bookmark') as tr:
554 with repo.transaction('bookmark') as tr:
555 if currentbookmarks:
555 if currentbookmarks:
@@ -562,8 +562,9 b' def rebase(ui, repo, **opts):'
562
562
563 ui.note(_("rebase completed\n"))
563 ui.note(_("rebase completed\n"))
564 util.unlinkpath(repo.sjoin('undo'), ignoremissing=True)
564 util.unlinkpath(repo.sjoin('undo'), ignoremissing=True)
565 if skipped:
565 if rbsrt.skipped:
566 ui.note(_("%d revisions have been skipped\n") % len(skipped))
566 skippedlen = len(rbsrt.skipped)
567 ui.note(_("%d revisions have been skipped\n") % skippedlen)
567
568
568 if (rbsrt.activebookmark and
569 if (rbsrt.activebookmark and
569 repo['.'].node() == repo._bookmarks[rbsrt.activebookmark]):
570 repo['.'].node() == repo._bookmarks[rbsrt.activebookmark]):
General Comments 0
You need to be logged in to leave comments. Login now