##// END OF EJS Templates
histedit: use progress helper...
Martin von Zweigbergk -
r38397:e5d87c69 default
parent child Browse files
Show More
@@ -1149,8 +1149,6 b' def _continuehistedit(ui, repo, state):'
1149 # even if there's an exception before the first transaction serialize.
1149 # even if there's an exception before the first transaction serialize.
1150 state.write()
1150 state.write()
1151
1151
1152 total = len(state.actions)
1153 pos = 0
1154 tr = None
1152 tr = None
1155 # Don't use singletransaction by default since it rolls the entire
1153 # Don't use singletransaction by default since it rolls the entire
1156 # transaction back if an unexpected exception happens (like a
1154 # transaction back if an unexpected exception happens (like a
@@ -1160,13 +1158,13 b' def _continuehistedit(ui, repo, state):'
1160 # and reopen a transaction. For example, if the action executes an
1158 # and reopen a transaction. For example, if the action executes an
1161 # external process it may choose to commit the transaction first.
1159 # external process it may choose to commit the transaction first.
1162 tr = repo.transaction('histedit')
1160 tr = repo.transaction('histedit')
1163 with util.acceptintervention(tr):
1161 progress = ui.makeprogress(_("editing"), unit=_('changes'),
1162 total=len(state.actions))
1163 with progress, util.acceptintervention(tr):
1164 while state.actions:
1164 while state.actions:
1165 state.write(tr=tr)
1165 state.write(tr=tr)
1166 actobj = state.actions[0]
1166 actobj = state.actions[0]
1167 pos += 1
1167 progress.increment(item=actobj.torule())
1168 ui.progress(_("editing"), pos, actobj.torule(),
1169 _('changes'), total)
1170 ui.debug('histedit: processing %s %s\n' % (actobj.verb,\
1168 ui.debug('histedit: processing %s %s\n' % (actobj.verb,\
1171 actobj.torule()))
1169 actobj.torule()))
1172 parentctx, replacement_ = actobj.run()
1170 parentctx, replacement_ = actobj.run()
@@ -1175,7 +1173,6 b' def _continuehistedit(ui, repo, state):'
1175 state.actions.pop(0)
1173 state.actions.pop(0)
1176
1174
1177 state.write()
1175 state.write()
1178 ui.progress(_("editing"), None)
1179
1176
1180 def _finishhistedit(ui, repo, state, fm):
1177 def _finishhistedit(ui, repo, state, fm):
1181 """This action runs when histedit is finishing its session"""
1178 """This action runs when histedit is finishing its session"""
General Comments 0
You need to be logged in to leave comments. Login now