grim/hgwebplus

Parents be21790699f8
Children cc8d1c536226
use the md5 function directly and remove the sha256 as we're not currently using it
  • +2 -14
    hgkeeper.py
  • --- a/hgkeeper.py Sat Mar 21 23:56:43 2020 -0500
    +++ b/hgkeeper.py Sun Mar 22 09:26:21 2020 -0500
    @@ -1,6 +1,6 @@
    # vi:et:ts=4 sw=4 sts=4
    -import hashlib
    +from hashlib import md5 as hashlib_md5
    from mercurial import extensions, patch, registrar
    from mercurial.hgweb import webutil
    @@ -8,21 +8,9 @@
    filters = {}
    templatefilter = registrar.templatefilter(filters)
    -def hexdigest(algo, text):
    - h = hashlib.new(algo)
    - h.update(text)
    -
    - return h.hexdigest()
    -
    -
    @templatefilter(b'md5', intype=bytes)
    def md5(text):
    - return hexdigest(b'md5', text)
    -
    -
    -@templatefilter(b'sha256', intype=bytes)
    -def sha256(text):
    - return hexdigest(b'sha256', text)
    + return hashlib_md5(text).hexdigest()
    def diffstats(web):