Patchwork [2,of,3] gpg: sigs() 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 <f91fc6f7357470849d85.1375926082@ElsonWei-NB.PrimeVOLT>
Download mbox | patch
Permalink /patch/2090/
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 f91fc6f7357470849d85cfa17d4fffaf54ec72d2
# Parent  a835e923601daaa2106c28f81c8cbe8618965128
gpg: sigs() 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
@@ -144,20 +144,14 @@ 
     mygpg = newgpg(ui)
     revs = {}
 
-    for data, context in sigwalk(repo):
-        node, version, sig = data
-        fn, ln = context
-        try:
-            n = repo.lookup(node)
-        except KeyError:
-            ui.warn(_("%s:%d node does not exist\n") % (fn, ln))
-            continue
-        r = repo.changelog.rev(n)
-        keys = getkeys(ui, repo, mygpg, data, context)
-        if not keys:
-            continue
+    for node in repo.signs:
+        r = repo.changelog.rev(node)
         revs.setdefault(r, [])
-        revs[r].extend(keys)
+        for data, context in repo.signs[node]:
+            keys = getkeys(ui, repo, mygpg, data, context)
+            if not keys:
+                continue
+            revs[r].extend(keys)
     for rev in sorted(revs, reverse=True):
         for k in revs[rev]:
             r = "%5d:%s" % (rev, hgnode.hex(repo.changelog.node(rev)))