Mercurial > evolve
comparison hgext3rd/topic/topicmap.py @ 6705:920f767589df
branching: merge with stable
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Sun, 25 Feb 2024 15:55:13 -0300 |
parents | 0f8dbea4458e 3635782b0290 |
children | 71c4b6c2bcdc |
comparison
equal
deleted
inserted
replaced
6703:cc49139f580f | 6705:920f767589df |
---|---|
67 funcmap[b'unfiltered-topic'] = lambda repo: frozenset() | 67 funcmap[b'unfiltered-topic'] = lambda repo: frozenset() |
68 partialmap[b'unfiltered-topic'] = b'visible-topic' | 68 partialmap[b'unfiltered-topic'] = b'visible-topic' |
69 | 69 |
70 def _phaseshash(repo, maxrev): | 70 def _phaseshash(repo, maxrev): |
71 """uniq ID for a phase matching a set of rev""" | 71 """uniq ID for a phase matching a set of rev""" |
72 revs = set() | |
73 cl = repo.changelog | 72 cl = repo.changelog |
74 fr = cl.filteredrevs | 73 fr = cl.filteredrevs |
75 getrev = compat.getgetrev(cl) | 74 nppr = compat.nonpublicphaseroots(repo) |
76 for n in compat.nonpublicphaseroots(repo): | 75 # starting with hg 6.7rc0 phase roots are already revs instead of nodes |
77 r = getrev(n) | 76 # hg <= 6.6 (68289ed170c7) |
78 if r not in fr and r < maxrev: | 77 if not util.safehasattr(repo._phasecache, '_phaseroots'): |
79 revs.add(r) | 78 getrev = compat.getgetrev(cl) |
79 nppr = set(getrev(n) for n in nppr) | |
80 revs = sorted(set(r for r in nppr if r not in fr and r < maxrev)) | |
80 key = nullid | 81 key = nullid |
81 revs = sorted(revs) | |
82 if revs: | 82 if revs: |
83 s = hashlib.sha1() | 83 s = hashlib.sha1() |
84 for rev in revs: | 84 for rev in revs: |
85 s.update(b'%d;' % rev) | 85 s.update(b'%d;' % rev) |
86 key = s.digest() | 86 key = s.digest() |