Patchwork [2,of,4,V5] gpg: getkeys() removes unused returning value "err"

login
register
mail settings
Submitter elson.wei@gmail.com
Date July 14, 2013, 1:52 p.m.
Message ID <750bda4b332c3eb91375.1373809933@ElsonWei-NB>
Download mbox | patch
Permalink /patch/1888/
State Accepted
Commit 33c72f054e168f0b23188f39888fbf04969e9f21
Headers show

Comments

elson.wei@gmail.com - July 14, 2013, 1:52 p.m.
# HG changeset patch
# User Wei, Elson <elson.wei@gmail.com>
# Date 1373595046 -28800
#      Fri Jul 12 10:10:46 2013 +0800
# Node ID 750bda4b332c3eb913750f26f496b988042da25f
# Parent  1b573beed7a3f34705d11007e5f183a51b6a0c33
gpg: getkeys() removes unused returning value "err"

Patch

# HG changeset patch
# User Wei, Elson <elson.wei@gmail.com>
# Date 1373595046 -28800
#      Fri Jul 12 10:10:46 2013 +0800
# Node ID 750bda4b332c3eb913750f26f496b988042da25f
# Parent  1b573beed7a3f34705d11007e5f183a51b6a0c33
gpg: getkeys() removes unused returning value "err"

diff --git a/hgext/gpg.py b/hgext/gpg.py
--- a/hgext/gpg.py
+++ b/hgext/gpg.py
@@ -48,7 +48,6 @@ 
                     pass
         keys = []
         key, fingerprint = None, None
-        err = ""
         for l in ret.splitlines():
             # see DETAILS in the gnupg documentation
             # filter the logger output
@@ -70,11 +69,9 @@ 
                     keys.append(key + [fingerprint])
                 key = l.split(" ", 2)
                 fingerprint = None
-        if err:
-            return err, []
         if key is not None:
             keys.append(key + [fingerprint])
-        return err, keys
+        return keys
 
 def newgpg(ui, **opts):
     """create a new gpg instance"""
@@ -120,10 +117,7 @@ 
 
     data = node2txt(repo, node, version)
     sig = binascii.a2b_base64(sig)
-    err, keys = mygpg.verify(data, sig)
-    if err:
-        ui.warn("%s:%d %s\n" % (fn, ln , err))
-        return None
+    keys = mygpg.verify(data, sig)
 
     validkeys = []
     # warn for expired key and/or sigs