histedit: break _histedit function into smaller pieces (add _continueaction)
authorKostia Balytskyi <ikostia@fb.com>
Sun, 14 Feb 2016 21:00:05 +0000
changeset 28133 8fc55388ece5
parent 28132 2d09a400b495
child 28134 df206e030c59
histedit: break _histedit function into smaller pieces (add _continueaction) This is a part of bigger effort to refactor histedit. Initial steps are to break _histedit function into smaller pieces which will supposedly be more understandable. After this is done, I will have a better understanding of how histedit works and apply that to fix issue4800.
hgext/histedit.py
--- a/hgext/histedit.py	Mon Feb 01 17:20:51 2016 +0000
+++ b/hgext/histedit.py	Sun Feb 14 21:00:05 2016 +0000
@@ -1036,7 +1036,6 @@
 
 
     state.keep = opts.get('keep', False)
-    supportsmarkers = obsolete.isenabled(repo, obsolete.createmarkersopt)
 
     # rebuild state
     if goal == 'continue':
@@ -1051,6 +1050,13 @@
     else:
         _newaction(ui, repo, state, revs, freeargs, opts)
 
+    _continueaction(ui, repo, state)
+
+def _continueaction(ui, repo, state):
+    """This action runs after either:
+    - bootstrapcontinue (if the goal is 'continue')
+    - _newaction (if the goal is 'new')
+    """
     # preprocess rules so that we can hide inner folds from the user
     # and only show one editor
     actions = state.actions[:]
@@ -1092,6 +1098,7 @@
                     for n in succs[1:]:
                         ui.debug(m % node.short(n))
 
+    supportsmarkers = obsolete.isenabled(repo, obsolete.createmarkersopt)
     if supportsmarkers:
         # Only create markers if the temp nodes weren't already removed.
         obsolete.createmarkers(repo, ((repo[t],()) for t in sorted(tmpnodes)