[PATCH 04 of 16] rebase: move targenancestors local variable to an object
Kostia Balytskyi
ikostia at fb.com
Sun May 29 18:38:35 EDT 2016
# HG changeset patch
# User Kostia Balytskyi <ikostia at fb.com>
# Date 1464520860 -3600
# Sun May 29 12:21:00 2016 +0100
# Node ID 907318e875e36be3d3350c1c047600f5302d79b3
# Parent f2cd1dfe743a66a7cf6ebe0abacce1d8e3f4ab87
rebase: move targenancestors local variable to an object
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -131,6 +131,7 @@
self.activebookmark = None
self.target = None
self.skipped = set()
+ self.targetancestors = set()
@command('rebase',
[('s', 'source', '',
@@ -243,8 +244,6 @@
"""
rtstate = RebaseRuntimeState()
- targetancestors = set()
-
lock = wlock = None
try:
@@ -377,10 +376,11 @@
(rtstate.originalwd, rtstate.target, rtstate.state) = result
if collapsef:
- targetancestors = repo.changelog.ancestors([rtstate.target],
- inclusive=True)
+ rtstate.targetancestors = repo.changelog.ancestors(
+ [rtstate.target],
+ inclusive=True)
rtstate.external = externalparent(repo, rtstate.state,
- targetancestors)
+ rtstate.targetancestors)
if dest.closesbranch() and not keepbranchesf:
ui.status(_('reopening closed branch head %s\n') % dest)
@@ -399,9 +399,9 @@
'branches'))
# Rebase
- if not targetancestors:
- targetancestors = repo.changelog.ancestors([rtstate.target],
- inclusive=True)
+ if not rtstate.targetancestors:
+ rtstate.targetancestors = repo.changelog.ancestors([rtstate.target],
+ inclusive=True)
# Keep track of the current bookmarks in order to reset them later
currentbookmarks = repo._bookmarks.copy()
@@ -428,7 +428,7 @@
_('changesets'), total)
p1, p2, base = defineparents(repo, rev, rtstate.target,
rtstate.state,
- targetancestors,
+ rtstate.targetancestors,
obsoletenotrebased)
storestatus(repo, rtstate.originalwd, rtstate.target,
rtstate.state, collapsef, keepf, keepbranchesf,
@@ -496,7 +496,8 @@
if collapsef and not keepopen:
p1, p2, _base = defineparents(repo, min(rtstate.state),
rtstate.target, rtstate.state,
- targetancestors, obsoletenotrebased)
+ rtstate.targetancestors,
+ obsoletenotrebased)
editopt = opts.get('edit')
editform = 'rebase.collapse'
if collapsemsg:
More information about the Mercurial-devel
mailing list