Commits

Martin Geisler  committed 516f965

Embed signature scheme in signature.

  • Participants
  • Parent commits d40c443

Comments (0)

Files changed (1)

File commitsigs.py

     else:
         revs = cmdutil.revrange(repo, revrange)
 
-    verifyfunc = sigschemes[CONFIG['scheme']][1]
-
     retcode = 0
     for rev in revs:
         ctx = repo[rev]
         else:
             ui.debug(_("signature: %s\n") % sig)
             try:
+                scheme, sig = sig.split(":", 1)
+                verifyfunc = sigschemes[scheme][1]
                 if verifyfunc(hex(h), sig, quiet=True):
                     msg = _("good signature")
                 else:
     def add(orig, self, manifest, files, desc, transaction,
             p1=None, p2=None, user=None, date=None, extra={}):
         h = chash(manifest, files, desc, p1, p2, user, date, extra)
-        signfunc = sigschemes[CONFIG['scheme']][0]
-        extra['signature'] = signfunc(hex(h))
+        scheme = CONFIG['scheme']
+        signfunc = sigschemes[scheme][0]
+        extra['signature'] = "%s:%s" % (scheme, signfunc(hex(h)))
         return orig(self, manifest, files, desc, transaction,
                     p1, p2, user, date, extra)