# HG changeset patch # User Anton Shestakov # Date 1708710729 10800 # Node ID 3635782b02900b35fd01acf70492d6b55ae6ffab # Parent ddebaa1613065325f9edb45c0bc700783b62cb88 topic: compatibility for phase roots being revnums diff -r ddebaa161306 -r 3635782b0290 hgext3rd/topic/topicmap.py --- a/hgext3rd/topic/topicmap.py Thu Feb 22 14:10:01 2024 -0300 +++ b/hgext3rd/topic/topicmap.py Fri Feb 23 14:52:09 2024 -0300 @@ -68,16 +68,16 @@ def _phaseshash(repo, maxrev): """uniq ID for a phase matching a set of rev""" - revs = set() cl = repo.changelog fr = cl.filteredrevs - getrev = compat.getgetrev(cl) - for n in compat.nonpublicphaseroots(repo): - r = getrev(n) - if r not in fr and r < maxrev: - revs.add(r) + nppr = compat.nonpublicphaseroots(repo) + # starting with hg 6.7rc0 phase roots are already revs instead of nodes + # hg <= 6.6 (68289ed170c7) + if not util.safehasattr(repo._phasecache, '_phaseroots'): + getrev = compat.getgetrev(cl) + nppr = set(getrev(n) for n in nppr) + revs = sorted(set(r for r in nppr if r not in fr and r < maxrev)) key = nullid - revs = sorted(revs) if revs: s = hashlib.sha1() for rev in revs: