[PATCH 19 of 23 v2] rebase: move currentbookmarks local variable to the rebase runtime class
Kostia Balytskyi
ikostia at fb.com
Tue May 31 19:23:39 EDT 2016
# HG changeset patch
# User Kostia Balytskyi <ikostia at fb.com>
# Date 1464610732 -3600
# Mon May 30 13:18:52 2016 +0100
# Node ID a94697839115b22cd1f847e77113045ae47a7926
# Parent feb91eb296574c4ae4011fb6ae4470276f102132
rebase: move currentbookmarks local variable to the rebase runtime class
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -134,6 +134,7 @@
# dict will be what contains most of the rebase progress state.
self.state = {}
self.activebookmark = None
+ self.currentbookmarks = None
self.target = None
self.skipped = set()
self.targetancestors = set()
@@ -496,7 +497,7 @@
inclusive=True)
# Keep track of the current bookmarks in order to reset them later
- currentbookmarks = repo._bookmarks.copy()
+ rtstate.currentbookmarks = repo._bookmarks.copy()
rtstate.activebookmark = rtstate.activebookmark or repo._activebookmark
if rtstate.activebookmark:
bookmarks.deactivate(repo)
@@ -620,7 +621,7 @@
if 'qtip' in repo.tags():
updatemq(repo, rtstate.state, rtstate.skipped, **opts)
- if currentbookmarks:
+ if rtstate.currentbookmarks:
# Nodeids are needed to reset bookmarks
nstate = {}
for k, v in rtstate.state.iteritems():
@@ -647,8 +648,9 @@
clearrebased(ui, repo, rtstate.state, rtstate.skipped, collapsedas)
with repo.transaction('bookmark') as tr:
- if currentbookmarks:
- updatebookmarks(repo, targetnode, nstate, currentbookmarks, tr)
+ if rtstate.currentbookmarks:
+ updatebookmarks(repo, targetnode, nstate,
+ rtstate.currentbookmarks, tr)
if rtstate.activebookmark not in repo._bookmarks:
# active bookmark was divergent one and has been deleted
rtstate.activebookmark = None
More information about the Mercurial-devel
mailing list