Mercurial > hg
comparison hgext/histedit.py @ 28153:17c474fdb225
histedit: break _histedit into smaller pieces (add _finishaction)
This is a part of a bigger effort to refactor histedit with ultimate
goal of understanding it.
author | Kostia Balytskyi <ikostia@fb.com> |
---|---|
date | Mon, 15 Feb 2016 12:07:33 +0000 |
parents | ed6d650b7cb7 |
children | 47f56b6bfed1 |
comparison
equal
deleted
inserted
replaced
28152:5ec1ce8fdf0a | 28153:17c474fdb225 |
---|---|
1062 else: | 1062 else: |
1063 # goal == goalnew | 1063 # goal == goalnew |
1064 _newaction(ui, repo, state, revs, freeargs, opts) | 1064 _newaction(ui, repo, state, revs, freeargs, opts) |
1065 | 1065 |
1066 _continueaction(ui, repo, state) | 1066 _continueaction(ui, repo, state) |
1067 _finishaction(ui, repo, state) | |
1067 | 1068 |
1068 def _continueaction(ui, repo, state): | 1069 def _continueaction(ui, repo, state): |
1069 """This action runs after either: | 1070 """This action runs after either: |
1070 - bootstrapcontinue (if the goal is 'continue') | 1071 - bootstrapcontinue (if the goal is 'continue') |
1071 - _newaction (if the goal is 'new') | 1072 - _newaction (if the goal is 'new') |
1092 state.parentctxnode = parentctx.node() | 1093 state.parentctxnode = parentctx.node() |
1093 state.replacements.extend(replacement_) | 1094 state.replacements.extend(replacement_) |
1094 state.write() | 1095 state.write() |
1095 ui.progress(_("editing"), None) | 1096 ui.progress(_("editing"), None) |
1096 | 1097 |
1098 def _finishaction(ui, repo, state): | |
1099 """This action runs when histedit is finishing its session""" | |
1097 repo.ui.pushbuffer() | 1100 repo.ui.pushbuffer() |
1098 hg.update(repo, state.parentctxnode, quietempty=True) | 1101 hg.update(repo, state.parentctxnode, quietempty=True) |
1099 repo.ui.popbuffer() | 1102 repo.ui.popbuffer() |
1100 | 1103 |
1101 mapping, tmpnodes, created, ntm = processreplacement(state) | 1104 mapping, tmpnodes, created, ntm = processreplacement(state) |