Skip to content
Snippets Groups Projects
Commit ed6d650b authored by Kostia Balytskyi's avatar Kostia Balytskyi
Browse files

histedit: change string literals to constants in goal naming

This is a part of bigger effort to refactor histedit with ultimate
goal of understanding it.
parent c754996f
No related branches found
No related tags found
No related merge requests found
......@@ -982,5 +982,10 @@
finally:
release(state.lock, state.wlock)
goalcontinue = 'continue'
goalabort = 'abort'
goaleditplan = 'edit-plan'
goalnew = 'new'
def _getgoal(opts):
if opts.get('continue'):
......@@ -985,4 +990,4 @@
def _getgoal(opts):
if opts.get('continue'):
return 'continue'
return goalcontinue
if opts.get('abort'):
......@@ -988,3 +993,3 @@
if opts.get('abort'):
return 'abort'
return goalabort
if opts.get('edit_plan'):
......@@ -990,6 +995,6 @@
if opts.get('edit_plan'):
return 'edit-plan'
return 'new'
return goaleditplan
return goalnew
def _validateargs(ui, repo, state, freeargs, opts, goal, rules, revs):
# TODO only abort if we try to histedit mq patches, not just
......@@ -1045,6 +1050,6 @@
_validateargs(ui, repo, state, freeargs, opts, goal, rules, revs)
# rebuild state
if goal == 'continue':
if goal == goalcontinue:
state.read()
state = bootstrapcontinue(ui, state, opts)
......@@ -1049,5 +1054,5 @@
state.read()
state = bootstrapcontinue(ui, state, opts)
elif goal == 'edit-plan':
elif goal == goaleditplan:
_editplanaction(ui, repo, state, rules)
return
......@@ -1052,6 +1057,6 @@
_editplanaction(ui, repo, state, rules)
return
elif goal == 'abort':
elif goal == goalabort:
_abortaction(ui, repo, state)
return
else:
......@@ -1055,6 +1060,7 @@
_abortaction(ui, repo, state)
return
else:
# goal == goalnew
_newaction(ui, repo, state, revs, freeargs, opts)
_continueaction(ui, repo, state)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment