hgext3rd/topic/topicmap.py
changeset 1968 08cbfeb15a1a
parent 1953 bdc5bb223b50
child 1970 076baad148d9
equal deleted inserted replaced
1967:c5d4e856ad0e 1968:08cbfeb15a1a
     1 import contextlib
     1 import contextlib
       
     2 import hashlib
     2 
     3 
     3 from mercurial.node import hex, bin, nullid
     4 from mercurial.node import hex, bin, nullid
     4 from mercurial import (
     5 from mercurial import (
     5     branchmap,
     6     branchmap,
     6     changegroup,
     7     changegroup,
    32             if r not in fr and r < maxrev:
    33             if r not in fr and r < maxrev:
    33                 revs.add(r)
    34                 revs.add(r)
    34     key = nullid
    35     key = nullid
    35     revs = sorted(revs)
    36     revs = sorted(revs)
    36     if revs:
    37     if revs:
    37         s = util.sha1()
    38         s = hashlib.sha1()
    38         for rev in revs:
    39         for rev in revs:
    39             s.update('%s;' % rev)
    40             s.update('%s;' % rev)
    40         key = s.digest()
    41         key = s.digest()
    41     return key
    42     return key
    42 
    43