comparison mercurial/transaction.py @ 50308:cab3defe6d3b stable

transaction: raise on backup restoration error A few line above, similar errors in the truncation code result in raising the associated exception. We should do the same here. This means the transaction recover is more strict now, which might be a problem when running `hg recover` in a share different from the one where the transaction fails. However this has always been a problem and need to be be addressed independently.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 15 Mar 2023 12:13:08 +0100
parents 70ca1f09ceca
children 86dc9e097bed
comparison
equal deleted inserted replaced
50307:70ca1f09ceca 50308:cab3defe6d3b
143 util.copyfile(backuppath, filepath, checkambig=checkambig) 143 util.copyfile(backuppath, filepath, checkambig=checkambig)
144 backupfiles.append((vfs, b)) 144 backupfiles.append((vfs, b))
145 except IOError as exc: 145 except IOError as exc:
146 e_msg = stringutil.forcebytestr(exc) 146 e_msg = stringutil.forcebytestr(exc)
147 report(_(b"failed to recover %s (%s)\n") % (f, e_msg)) 147 report(_(b"failed to recover %s (%s)\n") % (f, e_msg))
148 raise
148 else: 149 else:
149 target = f or b 150 target = f or b
150 try: 151 try:
151 vfs.unlink(target) 152 vfs.unlink(target)
152 except FileNotFoundError: 153 except FileNotFoundError: