##// END OF EJS Templates
histedit: limit mentioning histedit-last-edit.txt...
timeless -
r27543:ff0e4c8e default
parent child Browse files
Show More
@@ -902,11 +902,6 b' def histedit(ui, repo, *freeargs, **opts'
902 state.wlock = repo.wlock()
902 state.wlock = repo.wlock()
903 state.lock = repo.lock()
903 state.lock = repo.lock()
904 _histedit(ui, repo, state, *freeargs, **opts)
904 _histedit(ui, repo, state, *freeargs, **opts)
905 except error.Abort:
906 if repo.vfs.exists('histedit-last-edit.txt'):
907 ui.warn(_('warning: histedit rules saved '
908 'to: .hg/histedit-last-edit.txt\n'))
909 raise
910 finally:
905 finally:
911 release(state.lock, state.wlock)
906 release(state.lock, state.wlock)
912
907
@@ -987,7 +982,7 b' def _histedit(ui, repo, state, *freeargs'
987 actions = parserules(rules, state)
982 actions = parserules(rules, state)
988 ctxs = [repo[act.nodetoverify()] \
983 ctxs = [repo[act.nodetoverify()] \
989 for act in state.actions if act.nodetoverify()]
984 for act in state.actions if act.nodetoverify()]
990 verifyactions(actions, state, ctxs)
985 warnverifyactions(ui, repo, actions, state, ctxs)
991 state.actions = actions
986 state.actions = actions
992 state.write()
987 state.write()
993 return
988 return
@@ -1070,7 +1065,7 b' def _histedit(ui, repo, state, *freeargs'
1070 rules = f.read()
1065 rules = f.read()
1071 f.close()
1066 f.close()
1072 actions = parserules(rules, state)
1067 actions = parserules(rules, state)
1073 verifyactions(actions, state, ctxs)
1068 warnverifyactions(ui, repo, actions, state, ctxs)
1074
1069
1075 parentctxnode = repo[root].parents()[0].node()
1070 parentctxnode = repo[root].parents()[0].node()
1076
1071
@@ -1222,6 +1217,15 b' def parserules(rules, state):'
1222 actions.append(action)
1217 actions.append(action)
1223 return actions
1218 return actions
1224
1219
1220 def warnverifyactions(ui, repo, actions, state, ctxs):
1221 try:
1222 verifyactions(actions, state, ctxs)
1223 except error.Abort:
1224 if repo.vfs.exists('histedit-last-edit.txt'):
1225 ui.warn(_('warning: histedit rules saved '
1226 'to: .hg/histedit-last-edit.txt\n'))
1227 raise
1228
1225 def verifyactions(actions, state, ctxs):
1229 def verifyactions(actions, state, ctxs):
1226 """Verify that there exists exactly one action per given changeset and
1230 """Verify that there exists exactly one action per given changeset and
1227 other constraints.
1231 other constraints.
General Comments 0
You need to be logged in to leave comments. Login now