# HG changeset patch
# User Kostia Balytskyi <ikostia@fb.com>
# Date 1467374993 -7200
#      Fri Jul 01 14:09:53 2016 +0200
# Node ID fb7fc877ed17e2ea985bf455b1521fe1ab2dfa64
# Parent  56641501adde6810c0c6c6154dc75287eb04878b
rebase: move local variable 'currentbookmarks' to the RR class

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -135,6 +135,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()
@@ -492,7 +493,7 @@
                                                              inclusive=True)
 
         # Keep track of the current bookmarks in order to reset them later
-        currentbookmarks = repo._bookmarks.copy()
+        rbsrt.currentbookmarks = repo._bookmarks.copy()
         rbsrt.activebookmark = rbsrt.activebookmark or repo._activebookmark
         if rbsrt.activebookmark:
             bookmarks.deactivate(repo)
@@ -616,7 +617,7 @@
         if 'qtip' in repo.tags():
             updatemq(repo, rbsrt.state, rbsrt.skipped, **opts)
 
-        if currentbookmarks:
+        if rbsrt.currentbookmarks:
             # Nodeids are needed to reset bookmarks
             nstate = {}
             for k, v in rbsrt.state.iteritems():
@@ -648,8 +649,9 @@
             clearrebased(ui, repo, rbsrt.state, rbsrt.skipped, collapsedas)
 
         with repo.transaction('bookmark') as tr:
-            if currentbookmarks:
-                updatebookmarks(repo, targetnode, nstate, currentbookmarks, tr)
+            if rbsrt.currentbookmarks:
+                updatebookmarks(repo, targetnode, nstate,
+                                rbsrt.currentbookmarks, tr)
                 if rbsrt.activebookmark not in repo._bookmarks:
                     # active bookmark was divergent one and has been deleted
                     rbsrt.activebookmark = None