##// END OF EJS Templates
histedit: remove transaction from state object...
Martin von Zweigbergk -
r33444:c4e39512 default
parent child Browse files
Show More
@@ -280,7 +280,6 b' class histeditstate(object):'
280 self.lock = lock
280 self.lock = lock
281 self.wlock = wlock
281 self.wlock = wlock
282 self.backupfile = None
282 self.backupfile = None
283 self.tr = None
284 if replacements is None:
283 if replacements is None:
285 self.replacements = []
284 self.replacements = []
286 else:
285 else:
@@ -1110,7 +1109,7 b' def _continuehistedit(ui, repo, state):'
1110
1109
1111 total = len(state.actions)
1110 total = len(state.actions)
1112 pos = 0
1111 pos = 0
1113 state.tr = None
1112 tr = None
1114
1113
1115 # Force an initial state file write, so the user can run --abort/continue
1114 # Force an initial state file write, so the user can run --abort/continue
1116 # even if there's an exception before the first transaction serialize.
1115 # even if there's an exception before the first transaction serialize.
@@ -1123,10 +1122,10 b' def _continuehistedit(ui, repo, state):'
1123 # Don't use a 'with' for the transaction, since actions may close
1122 # Don't use a 'with' for the transaction, since actions may close
1124 # and reopen a transaction. For example, if the action executes an
1123 # and reopen a transaction. For example, if the action executes an
1125 # external process it may choose to commit the transaction first.
1124 # external process it may choose to commit the transaction first.
1126 state.tr = repo.transaction('histedit')
1125 tr = repo.transaction('histedit')
1127
1126
1128 while state.actions:
1127 while state.actions:
1129 state.write(tr=state.tr)
1128 state.write(tr=tr)
1130 actobj = state.actions[0]
1129 actobj = state.actions[0]
1131 pos += 1
1130 pos += 1
1132 ui.progress(_("editing"), pos, actobj.torule(),
1131 ui.progress(_("editing"), pos, actobj.torule(),
@@ -1138,15 +1137,15 b' def _continuehistedit(ui, repo, state):'
1138 state.replacements.extend(replacement_)
1137 state.replacements.extend(replacement_)
1139 state.actions.pop(0)
1138 state.actions.pop(0)
1140
1139
1141 if state.tr is not None:
1140 if tr is not None:
1142 state.tr.close()
1141 tr.close()
1143 except error.InterventionRequired:
1142 except error.InterventionRequired:
1144 if state.tr is not None:
1143 if tr is not None:
1145 state.tr.close()
1144 tr.close()
1146 raise
1145 raise
1147 except Exception:
1146 except Exception:
1148 if state.tr is not None:
1147 if tr is not None:
1149 state.tr.abort()
1148 tr.abort()
1150 raise
1149 raise
1151
1150
1152 state.write()
1151 state.write()
General Comments 0
You need to be logged in to leave comments. Login now