comparison hgext3rd/topic/topicmap.py @ 4929:bb2b4f6c99dc

compat: compatibility for cl.nodemap.get vs cl.index.get_rev
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 13 Nov 2019 13:47:55 +0700
parents 48b30ff742cb
children a4d081923c81
comparison
equal deleted inserted replaced
4928:379ce8ba150d 4929:bb2b4f6c99dc
12 util, 12 util,
13 ) 13 )
14 14
15 from . import ( 15 from . import (
16 common, 16 common,
17 compat,
17 ) 18 )
18 19
19 basefilter = set([b'base', b'immutable']) 20 basefilter = set([b'base', b'immutable'])
20 def topicfilter(name): 21 def topicfilter(name):
21 """return a "topic" version of a filter level""" 22 """return a "topic" version of a filter level"""
67 def _phaseshash(repo, maxrev): 68 def _phaseshash(repo, maxrev):
68 """uniq ID for a phase matching a set of rev""" 69 """uniq ID for a phase matching a set of rev"""
69 revs = set() 70 revs = set()
70 cl = repo.changelog 71 cl = repo.changelog
71 fr = cl.filteredrevs 72 fr = cl.filteredrevs
72 nm = cl.nodemap 73 getrev = compat.getgetrev(cl)
73 for roots in repo._phasecache.phaseroots[1:]: 74 for roots in repo._phasecache.phaseroots[1:]:
74 for n in roots: 75 for n in roots:
75 r = nm.get(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)
78 key = nullid 79 key = nullid
79 revs = sorted(revs) 80 revs = sorted(revs)
80 if revs: 81 if revs: