##// END OF EJS Templates
histedit: create transaction outside of try...
Martin von Zweigbergk -
r33445:0491004e default
parent child Browse files
Show More
@@ -1107,23 +1107,22 b' def _continuehistedit(ui, repo, state):'
1107 1107 if action.verb == 'fold' and nextact and nextact.verb == 'fold':
1108 1108 state.actions[idx].__class__ = _multifold
1109 1109
1110 total = len(state.actions)
1111 pos = 0
1112 tr = None
1113
1114 1110 # Force an initial state file write, so the user can run --abort/continue
1115 1111 # even if there's an exception before the first transaction serialize.
1116 1112 state.write()
1113
1114 total = len(state.actions)
1115 pos = 0
1116 tr = None
1117 # Don't use singletransaction by default since it rolls the entire
1118 # transaction back if an unexpected exception happens (like a
1119 # pretxncommit hook throws, or the user aborts the commit msg editor).
1120 if ui.configbool("histedit", "singletransaction", False):
1121 # Don't use a 'with' for the transaction, since actions may close
1122 # and reopen a transaction. For example, if the action executes an
1123 # external process it may choose to commit the transaction first.
1124 tr = repo.transaction('histedit')
1117 1125 try:
1118 # Don't use singletransaction by default since it rolls the entire
1119 # transaction back if an unexpected exception happens (like a
1120 # pretxncommit hook throws, or the user aborts the commit msg editor).
1121 if ui.configbool("histedit", "singletransaction", False):
1122 # Don't use a 'with' for the transaction, since actions may close
1123 # and reopen a transaction. For example, if the action executes an
1124 # external process it may choose to commit the transaction first.
1125 tr = repo.transaction('histedit')
1126
1127 1126 while state.actions:
1128 1127 state.write(tr=tr)
1129 1128 actobj = state.actions[0]
General Comments 0
You need to be logged in to leave comments. Login now