Right now we issue a message about failing to recover some file, but not why.
It seems useful to add some information about that.
(This is an opportunity improvement while looking at something next to that.)
pulkit |
hg-reviewers |
Right now we issue a message about failing to recover some file, but not why.
It seems useful to add some information about that.
(This is an opportunity improvement while looking at something next to that.)
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/transaction.py (5 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Abandoned | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute |
try: | try: | ||||
if f and b: | if f and b: | ||||
filepath = vfs.join(f) | filepath = vfs.join(f) | ||||
backuppath = vfs.join(b) | backuppath = vfs.join(b) | ||||
checkambig = checkambigfiles and (f, l) in checkambigfiles | checkambig = checkambigfiles and (f, l) in checkambigfiles | ||||
try: | try: | ||||
util.copyfile(backuppath, filepath, checkambig=checkambig) | util.copyfile(backuppath, filepath, checkambig=checkambig) | ||||
backupfiles.append(b) | backupfiles.append(b) | ||||
except IOError: | except IOError as exc: | ||||
report(_(b"failed to recover %s\n") % f) | e_msg = stringutil.forcebytestr(exc) | ||||
report(_(b"failed to recover %s (%s)\n") % (f, e_msg)) | |||||
else: | else: | ||||
target = f or b | target = f or b | ||||
try: | try: | ||||
vfs.unlink(target) | vfs.unlink(target) | ||||
except (IOError, OSError) as inst: | except (IOError, OSError) as inst: | ||||
if inst.errno != errno.ENOENT: | if inst.errno != errno.ENOENT: | ||||
raise | raise | ||||
except (IOError, OSError, error.Abort): | except (IOError, OSError, error.Abort): |