changeset 19970:065e6f1c9259 stable

shelve: remove unused variable assignment Fix test-check-pyflakes.t error after 1d7a36ff2615. This patch replaces "readshelvedfiles()" invocation by "shelvedfile().exists()" check and aborting, because it is required only to ensure that shelved changes corresponded to specified name exist after invocation. This patch also remove definition of "readshelvedfiles()" itself, because it is invoked only from the line removed by this patch.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sat, 02 Nov 2013 04:49:42 +0900
parents ad9db007656f
children 2a9bb64faa0b
files hgext/shelve.py
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/shelve.py	Wed Oct 30 19:45:14 2013 +0100
+++ b/hgext/shelve.py	Sat Nov 02 04:49:42 2013 +0900
@@ -349,11 +349,6 @@
         finally:
             fp.close()
 
-def readshelvedfiles(repo, basename):
-    """return the list of files touched in a shelve"""
-    fp = shelvedfile(repo, basename, 'files').opener()
-    return fp.read().split('\0')
-
 def checkparents(repo, state):
     """check parent while resuming an unshelve"""
     if state.parents != repo.dirstate.parents():
@@ -523,7 +518,8 @@
     else:
         basename = shelved[0]
 
-    shelvedfiles = readshelvedfiles(repo, basename)
+    if not shelvedfile(repo, basename, 'files').exists():
+        raise util.Abort(_("shelved change '%s' not found") % basename)
 
     wlock = lock = tr = None
     try: