shelve: fix a missing variable in the exception handler for delete
Caught by pytype. I haven't paid much attention to the progress of this
extension, but I *think* this was the intent.
Differential Revision: https://phab.mercurial-scm.org/D7457
--- a/mercurial/shelve.py Tue Nov 19 11:59:43 2019 +0100
+++ b/mercurial/shelve.py Tue Nov 19 14:36:22 2019 -0500
@@ -603,8 +603,8 @@
if not pats:
raise error.Abort(_(b'no shelved changes specified!'))
with repo.wlock():
- try:
- for name in pats:
+ for name in pats:
+ try:
for suffix in shelvefileextensions:
shfile = shelvedfile(repo, name, suffix)
# patch file is necessary, as it should
@@ -614,11 +614,11 @@
# bundle
if shfile.exists() or suffix == patchextension:
shfile.movetobackup()
+ except OSError as err:
+ if err.errno != errno.ENOENT:
+ raise
+ raise error.Abort(_(b"shelved change '%s' not found") % name)
cleanupoldbackups(repo)
- except OSError as err:
- if err.errno != errno.ENOENT:
- raise
- raise error.Abort(_(b"shelved change '%s' not found") % name)
def listshelves(repo):