Patchwork D7457: shelve: fix a missing variable in the exception handler for delete

login
register
mail settings
Submitter phabricator
Date Nov. 21, 2019, 1:40 p.m.
Message ID <e37b95a3296ea2918c9902383856122e@localhost.localdomain>
Download mbox | patch
Permalink /patch/43385/
State Not Applicable
Headers show

Comments

phabricator - Nov. 21, 2019, 1:40 p.m.
Closed by commit rHGcb23d9e3e21f: shelve: fix a missing variable in the exception handler for delete (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7457?vs=18246&id=18260

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7457/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7457

AFFECTED FILES
  mercurial/shelve.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers, dlax, pulkit
Cc: dlax, mercurial-devel

Patch

diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -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):