[PATCH 3 of 4 V4] gpg: add shortkey() to convert from long id to short

elson.wei at gmail.com elson.wei at gmail.com
Thu Jul 11 21:20:39 CDT 2013


# HG changeset patch
# User Wei, Elson <elson.wei at gmail.com>
# Date 1373595319 -28800
#      Fri Jul 12 10:15:19 2013 +0800
# Node ID 67fe87db273db79c14b5d2c251b34b92275c691e
# Parent  750bda4b332c3eb913750f26f496b988042da25f
gpg: add shortkey() to convert from long id to short

diff --git a/hgext/gpg.py b/hgext/gpg.py
--- a/hgext/gpg.py
+++ b/hgext/gpg.py
@@ -276,6 +276,12 @@
     except ValueError, inst:
         raise util.Abort(str(inst))
 
+def shortkey(key):
+    if len(key) == 16:
+        return key[-8:]
+    else:
+        return key
+
 def node2txt(repo, node, ver):
     """map a manifest into some text"""
     if ver == "0":
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2013-07-10_12-50-44_r19380+.diff
Type: text/x-patch
Size: 644 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20130712/0bfc1023/attachment.bin>


More information about the Mercurial-devel mailing list