##// END OF EJS Templates
histedit: properly apply bundle2 backups...
Pierre-Yves David -
r26798:38dcb85f default
parent child Browse files
Show More
@@ -160,6 +160,7 b' import errno'
160 160 import os
161 161 import sys
162 162
163 from mercurial import bundle2
163 164 from mercurial import cmdutil
164 165 from mercurial import discovery
165 166 from mercurial import error
@@ -822,7 +823,18 b' def _histedit(ui, repo, state, *freeargs'
822 823 backupfile = repo.join(state.backupfile)
823 824 f = hg.openpath(ui, backupfile)
824 825 gen = exchange.readbundle(ui, f, backupfile)
825 gen.apply(repo, 'histedit', 'bundle:' + backupfile)
826 tr = repo.transaction('histedit.abort')
827 try:
828 if not isinstance(gen, bundle2.unbundle20):
829 gen.apply(repo, 'histedit', 'bundle:' + backupfile)
830 if isinstance(gen, bundle2.unbundle20):
831 bundle2.applybundle(repo, gen, tr,
832 source='histedit',
833 url='bundle:' + backupfile)
834 tr.close()
835 finally:
836 tr.release()
837
826 838 os.remove(backupfile)
827 839
828 840 # check whether we should update away
General Comments 0
You need to be logged in to leave comments. Login now