##// END OF EJS Templates
transaction: properly clean up backup file outside of .hg/store/...
marmoute -
r51232:90276164 stable
parent child Browse files
Show More
@@ -141,7 +141,7 b' def _playback('
141 checkambig = checkambigfiles and (f, l) in checkambigfiles
141 checkambig = checkambigfiles and (f, l) in checkambigfiles
142 try:
142 try:
143 util.copyfile(backuppath, filepath, checkambig=checkambig)
143 util.copyfile(backuppath, filepath, checkambig=checkambig)
144 backupfiles.append(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))
@@ -160,9 +160,9 b' def _playback('
160 opener.unlink(backuppath)
160 opener.unlink(backuppath)
161 opener.unlink(journal)
161 opener.unlink(journal)
162 try:
162 try:
163 for f in backupfiles:
163 for vfs, f in backupfiles:
164 if opener.exists(f):
164 if vfs.exists(f):
165 opener.unlink(f)
165 vfs.unlink(f)
166 except (IOError, OSError, error.Abort):
166 except (IOError, OSError, error.Abort):
167 # only pure backup file remains, it is sage to ignore any error
167 # only pure backup file remains, it is sage to ignore any error
168 pass
168 pass
General Comments 0
You need to be logged in to leave comments. Login now