Patchwork [topic-ext] compat: mercurial dropped alias for hashlib.sha1

login
register
mail settings
Submitter timeless
Date July 8, 2016, 4:25 p.m.
Message ID <d2c12f6a4e0b56cf0400.1467995121@gcc2-power8.osuosl.org>
Download mbox | patch
Permalink /patch/15776/
State Superseded
Headers show

Comments

timeless - July 8, 2016, 4:25 p.m.
# HG changeset patch
# User timeless@gmail.com
# Date 1467994195 0
#      Fri Jul 08 16:09:55 2016 +0000
# Node ID d2c12f6a4e0b56cf040057c88fa542696bf2a069
# Parent  c5d4e856ad0e971e055913269acc5a6a313d3c2e
compat: mercurial dropped alias for hashlib.sha1
Sean Farley - July 8, 2016, 6:38 p.m.
timeless <timeless@fmr.im> writes:

> # HG changeset patch
> # User timeless@gmail.com
> # Date 1467994195 0
> #      Fri Jul 08 16:09:55 2016 +0000
> # Node ID d2c12f6a4e0b56cf040057c88fa542696bf2a069
> # Parent  c5d4e856ad0e971e055913269acc5a6a313d3c2e
> compat: mercurial dropped alias for hashlib.sha1

Heh, I have this patch locally as well. LGTM

Patch

diff -r c5d4e856ad0e -r d2c12f6a4e0b hgext3rd/topic/topicmap.py
--- a/hgext3rd/topic/topicmap.py	Wed May 11 16:22:52 2016 +0200
+++ b/hgext3rd/topic/topicmap.py	Fri Jul 08 16:09:55 2016 +0000
@@ -1,4 +1,5 @@ 
 import contextlib
+import hashlib
 
 from mercurial.node import hex, bin, nullid
 from mercurial import (
@@ -34,7 +35,7 @@ 
     key = nullid
     revs = sorted(revs)
     if revs:
-        s = util.sha1()
+        s = hashlib.sha1()
         for rev in revs:
             s.update('%s;' % rev)
         key = s.digest()