comparison hgext3rd/topic/topicmap.py @ 5429:e4c7d4a03de7 stable

topic: compatibility with sparse phaseroots and phasesets in 5.5 See also: https://phab.mercurial-scm.org/D8694 and its stack.
author Joerg Sonnenberger <joerg@bec.de>
date Tue, 21 Jul 2020 11:59:28 +0800
parents a4d081923c81
children dd9dba7c1d00
comparison
equal deleted inserted replaced
5428:3214dc282085 5429:e4c7d4a03de7
69 """uniq ID for a phase matching a set of rev""" 69 """uniq ID for a phase matching a set of rev"""
70 revs = set() 70 revs = set()
71 cl = repo.changelog 71 cl = repo.changelog
72 fr = cl.filteredrevs 72 fr = cl.filteredrevs
73 getrev = compat.getgetrev(cl) 73 getrev = compat.getgetrev(cl)
74 for roots in repo._phasecache.phaseroots[1:]: 74 for n in compat.nonpublicphaseroots(repo):
75 for n in roots: 75 r = getrev(n)
76 r = getrev(n) 76 if r not in fr and r < maxrev:
77 if r not in fr and r < maxrev: 77 revs.add(r)
78 revs.add(r)
79 key = nullid 78 key = nullid
80 revs = sorted(revs) 79 revs = sorted(revs)
81 if revs: 80 if revs:
82 s = hashlib.sha1() 81 s = hashlib.sha1()
83 for rev in revs: 82 for rev in revs: