##// END OF EJS Templates
histedit: change string literals to constants in goal naming...
Kostia Balytskyi -
r28144:ed6d650b default
parent child Browse files
Show More
@@ -982,14 +982,19 b' def histedit(ui, repo, *freeargs, **opts'
982 finally:
982 finally:
983 release(state.lock, state.wlock)
983 release(state.lock, state.wlock)
984
984
985 goalcontinue = 'continue'
986 goalabort = 'abort'
987 goaleditplan = 'edit-plan'
988 goalnew = 'new'
989
985 def _getgoal(opts):
990 def _getgoal(opts):
986 if opts.get('continue'):
991 if opts.get('continue'):
987 return 'continue'
992 return goalcontinue
988 if opts.get('abort'):
993 if opts.get('abort'):
989 return 'abort'
994 return goalabort
990 if opts.get('edit_plan'):
995 if opts.get('edit_plan'):
991 return 'edit-plan'
996 return goaleditplan
992 return 'new'
997 return goalnew
993
998
994 def _validateargs(ui, repo, state, freeargs, opts, goal, rules, revs):
999 def _validateargs(ui, repo, state, freeargs, opts, goal, rules, revs):
995 # TODO only abort if we try to histedit mq patches, not just
1000 # TODO only abort if we try to histedit mq patches, not just
@@ -1045,16 +1050,17 b' def _histedit(ui, repo, state, *freeargs'
1045 _validateargs(ui, repo, state, freeargs, opts, goal, rules, revs)
1050 _validateargs(ui, repo, state, freeargs, opts, goal, rules, revs)
1046
1051
1047 # rebuild state
1052 # rebuild state
1048 if goal == 'continue':
1053 if goal == goalcontinue:
1049 state.read()
1054 state.read()
1050 state = bootstrapcontinue(ui, state, opts)
1055 state = bootstrapcontinue(ui, state, opts)
1051 elif goal == 'edit-plan':
1056 elif goal == goaleditplan:
1052 _editplanaction(ui, repo, state, rules)
1057 _editplanaction(ui, repo, state, rules)
1053 return
1058 return
1054 elif goal == 'abort':
1059 elif goal == goalabort:
1055 _abortaction(ui, repo, state)
1060 _abortaction(ui, repo, state)
1056 return
1061 return
1057 else:
1062 else:
1063 # goal == goalnew
1058 _newaction(ui, repo, state, revs, freeargs, opts)
1064 _newaction(ui, repo, state, revs, freeargs, opts)
1059
1065
1060 _continueaction(ui, repo, state)
1066 _continueaction(ui, repo, state)
General Comments 0
You need to be logged in to leave comments. Login now