##// END OF EJS Templates
histedit: break _histedit function into smaller pieces (add _editplanaction)...
Kostia Balytskyi -
r28131:5a2fb268 default
parent child Browse files
Show More
@@ -1044,24 +1044,7 b' def _histedit(ui, repo, state, *freeargs'
1044 state.read()
1044 state.read()
1045 state = bootstrapcontinue(ui, state, opts)
1045 state = bootstrapcontinue(ui, state, opts)
1046 elif goal == 'edit-plan':
1046 elif goal == 'edit-plan':
1047 state.read()
1047 _editplanaction(ui, repo, state, rules)
1048 if not rules:
1049 comment = geteditcomment(node.short(state.parentctxnode),
1050 node.short(state.topmost))
1051 rules = ruleeditor(repo, ui, state.actions, comment)
1052 else:
1053 if rules == '-':
1054 f = sys.stdin
1055 else:
1056 f = open(rules)
1057 rules = f.read()
1058 f.close()
1059 actions = parserules(rules, state)
1060 ctxs = [repo[act.nodetoverify()] \
1061 for act in state.actions if act.nodetoverify()]
1062 warnverifyactions(ui, repo, actions, state, ctxs)
1063 state.actions = actions
1064 state.write()
1065 return
1048 return
1066 elif goal == 'abort':
1049 elif goal == 'abort':
1067 _abortaction(ui, repo, state)
1050 _abortaction(ui, repo, state)
@@ -1225,6 +1208,26 b' def _abortaction(ui, repo, state):'
1225 finally:
1208 finally:
1226 state.clear()
1209 state.clear()
1227
1210
1211 def _editplanaction(ui, repo, state, rules):
1212 state.read()
1213 if not rules:
1214 comment = geteditcomment(node.short(state.parentctxnode),
1215 node.short(state.topmost))
1216 rules = ruleeditor(repo, ui, state.actions, comment)
1217 else:
1218 if rules == '-':
1219 f = sys.stdin
1220 else:
1221 f = open(rules)
1222 rules = f.read()
1223 f.close()
1224 actions = parserules(rules, state)
1225 ctxs = [repo[act.nodetoverify()] \
1226 for act in state.actions if act.nodetoverify()]
1227 warnverifyactions(ui, repo, actions, state, ctxs)
1228 state.actions = actions
1229 state.write()
1230
1228 def bootstrapcontinue(ui, state, opts):
1231 def bootstrapcontinue(ui, state, opts):
1229 repo = state.repo
1232 repo = state.repo
1230 if state.actions:
1233 if state.actions:
General Comments 0
You need to be logged in to leave comments. Login now