comparison mercurial/dagutil.py @ 39164:01ab7f656a10

dagutil: remove nodeset() AFAICT this was unused since the code was introduced by cb98fed52495 in 2011! Differential Revision: https://phab.mercurial-scm.org/D4309
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 16 Aug 2018 20:11:45 +0000
parents 9539553f6d17
children 136ed75bbe12
comparison
equal deleted inserted replaced
39163:26f3d075f36e 39164:01ab7f656a10
21 Pluralized params are lists or sets. 21 Pluralized params are lists or sets.
22 ''' 22 '''
23 23
24 def __init__(self): 24 def __init__(self):
25 self._inverse = None 25 self._inverse = None
26
27 def nodeset(self):
28 '''set of all node ixs'''
29 raise NotImplementedError
30 26
31 def heads(self): 27 def heads(self):
32 '''list of head ixs''' 28 '''list of head ixs'''
33 raise NotImplementedError 29 raise NotImplementedError
34 30
90 86
91 87
92 class revlogbaseddag(basedag): 88 class revlogbaseddag(basedag):
93 '''generic dag interface to a revlog''' 89 '''generic dag interface to a revlog'''
94 90
95 def __init__(self, revlog, nodeset): 91 def __init__(self, revlog):
96 basedag.__init__(self) 92 basedag.__init__(self)
97 self._revlog = revlog 93 self._revlog = revlog
98 self._heads = None 94 self._heads = None
99 self._nodeset = nodeset
100
101 def nodeset(self):
102 return self._nodeset
103 95
104 def heads(self): 96 def heads(self):
105 if self._heads is None: 97 if self._heads is None:
106 self._heads = self._getheads() 98 self._heads = self._getheads()
107 return self._heads 99 return self._heads
108 100
109 class revlogdag(revlogbaseddag): 101 class revlogdag(revlogbaseddag):
110 '''dag interface to a revlog''' 102 '''dag interface to a revlog'''
111 103
112 def __init__(self, revlog, localsubset=None): 104 def __init__(self, revlog, localsubset=None):
113 revlogbaseddag.__init__(self, revlog, set(revlog)) 105 revlogbaseddag.__init__(self, revlog)
114 self._heads = localsubset 106 self._heads = localsubset
115 107
116 def _getheads(self): 108 def _getheads(self):
117 return [r for r in self._revlog.headrevs() if r != nullrev] 109 return [r for r in self._revlog.headrevs() if r != nullrev]
118 110
202 194
203 class inverserevlogdag(revlogbaseddag, genericdag): 195 class inverserevlogdag(revlogbaseddag, genericdag):
204 '''inverse of an existing revlog dag; see revlogdag.inverse()''' 196 '''inverse of an existing revlog dag; see revlogdag.inverse()'''
205 197
206 def __init__(self, orig): 198 def __init__(self, orig):
207 revlogbaseddag.__init__(self, orig._revlog, orig._nodeset) 199 revlogbaseddag.__init__(self, orig._revlog)
208 self._orig = orig 200 self._orig = orig
209 self._children = {} 201 self._children = {}
210 self._roots = [] 202 self._roots = []
211 self._walkfrom = len(self._revlog) - 1 203 self._walkfrom = len(self._revlog) - 1
212 204