Patchwork [3,of,3] gpg: check() gets signature data from repo.signs instead of sigwalk()

login
register
mail settings
Submitter elson.wei@gmail.com
Date Aug. 8, 2013, 1:41 a.m.
Message ID <c2bd21d75f8430bf385b.1375926083@ElsonWei-NB.PrimeVOLT>
Download mbox | patch
Permalink /patch/2091/
State Changes Requested
Headers show

Comments

elson.wei@gmail.com - Aug. 8, 2013, 1:41 a.m.
# HG changeset patch
# User Wei, Elson <elson.wei@gmail.com>
# Date 1375841212 -28800
#      Wed Aug 07 10:06:52 2013 +0800
# Node ID c2bd21d75f8430bf385b3ec52f25ed712846946f
# Parent  f91fc6f7357470849d85cfa17d4fffaf54ec72d2
gpg: check() gets signature data from repo.signs instead of sigwalk()

Patch

diff --git a/hgext/gpg.py b/hgext/gpg.py
--- a/hgext/gpg.py
+++ b/hgext/gpg.py
@@ -162,15 +162,12 @@ 
     """verify all the signatures there may be for a particular revision"""
     mygpg = newgpg(ui)
     rev = repo.lookup(rev)
-    hexrev = hgnode.hex(rev)
     keys = []
 
-    for data, context in sigwalk(repo):
-        node, version, sig = data
-        if node == hexrev:
-            k = getkeys(ui, repo, mygpg, data, context)
-            if k:
-                keys.extend(k)
+    for data, context in repo.signs[rev]:
+        k = getkeys(ui, repo, mygpg, data, context)
+        if k:
+            keys.extend(k)
 
     if not keys:
         ui.write(_("no valid signature for %s\n") % hgnode.short(rev))