Submitter | elson.wei@gmail.com |
---|---|
Date | June 20, 2013, 7:34 a.m. |
Message ID | <5d7e94383feede6e5b62.1371713654@ElsonWei-NB.PrimeVOLT> |
Download | mbox | patch |
Permalink | /patch/1735/ |
State | Superseded, archived |
Headers | show |
Comments
On Thu, Jun 20, 2013 at 9:34 AM, <elson.wei@gmail.com> wrote: > # HG changeset patch > # User Wei, Elson <elson.wei@gmail.com> > # Date 1371690961 -28800 > # Thu Jun 20 09:16:01 2013 +0800 > # Node ID 5d7e94383feede6e5b62d4009a3877e479f72591 > # Parent 401b3ad26e66f6b69937e1aa808da07065c408a6 > gpg: treat "ERRSIG" as a valid keyid but no fingerprint > > 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 > @@ -56,8 +55,7 @@ > continue > l = l[9:] > if l.startswith("ERRSIG"): > - err = _("error while verifying signature") > - break > + keys.append(l.split(" ", 2)[:2] + ["", ""]) > Can't you move that to the other block? (and please fold both patch together they are not independent) Cheers, Benoit > elif l.startswith("VALIDSIG"): > # fingerprint of the primary key > fingerprint = l.split()[10] > @@ -69,11 +67,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""" > @@ -119,10 +115,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 > _______________________________________________ > Mercurial-devel mailing list > Mercurial-devel@selenic.com > http://selenic.com/mailman/listinfo/mercurial-devel >
Patch
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 @@ -56,8 +55,7 @@ continue l = l[9:] if l.startswith("ERRSIG"): - err = _("error while verifying signature") - break + keys.append(l.split(" ", 2)[:2] + ["", ""]) elif l.startswith("VALIDSIG"): # fingerprint of the primary key fingerprint = l.split()[10] @@ -69,11 +67,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""" @@ -119,10 +115,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