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

login
register
mail settings
Submitter timeless
Date July 8, 2016, 5:02 p.m.
Message ID <d2c12f6a4e0b56cf0400.1467997331@gcc2-power8.osuosl.org>
Download mbox | patch
Permalink /patch/15775/
State Accepted
Headers show

Comments

timeless - July 8, 2016, 5:02 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
Jun Wu - July 8, 2016, 5:43 p.m.
Pre-Reviewed!

Excerpts from timeless's message of 2016-07-08 17:02:11 +0000:
> # 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
> 
> 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()
Pierre-Yves David - July 13, 2016, 4:29 p.m.
Pushed, thanks

On 07/08/2016 07:43 PM, Jun Wu wrote:
> Pre-Reviewed!
> 
> Excerpts from timeless's message of 2016-07-08 17:02:11 +0000:
>> # 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
>>
>> 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()
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

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()