##// END OF EJS Templates
discovery: use a lower level but faster way to retrieve parents...
marmoute -
r42047:e514799e default
parent child Browse files
Show More
@@ -165,6 +165,12 b' class partialdiscovery(object):'
165 165 # common.bases and all its ancestors
166 166 return self._common.basesheads()
167 167
168 def _parentsgetter(self):
169 getrev = self._repo.changelog.index.__getitem__
170 def getparents(r):
171 return getrev(r)[5:6]
172 return getparents
173
168 174 def takequicksample(self, headrevs, size):
169 175 """takes a quick sample of size <size>
170 176
@@ -181,7 +187,7 b' class partialdiscovery(object):'
181 187 if len(sample) >= size:
182 188 return _limitsample(sample, size)
183 189
184 _updatesample(None, headrevs, sample, self._repo.changelog.parentrevs,
190 _updatesample(None, headrevs, sample, self._parentsgetter(),
185 191 quicksamplesize=size)
186 192 return sample
187 193
@@ -191,10 +197,11 b' class partialdiscovery(object):'
191 197 return list(revs)
192 198 repo = self._repo
193 199 sample = set(repo.revs('heads(%ld)', revs))
200 parentrevs = self._parentsgetter()
194 201
195 202 # update from heads
196 203 revsheads = sample.copy()
197 _updatesample(revs, revsheads, sample, repo.changelog.parentrevs)
204 _updatesample(revs, revsheads, sample, parentrevs)
198 205
199 206 # update from roots
200 207 revsroots = set(repo.revs('roots(%ld)', revs))
@@ -209,7 +216,6 b' class partialdiscovery(object):'
209 216 # this by keeping a persistent cache of children across invocations.
210 217 children = {}
211 218
212 parentrevs = repo.changelog.parentrevs
213 219 for rev in repo.changelog.revs(start=min(revsroots)):
214 220 # Always ensure revision has an entry so we don't need to worry
215 221 # about missing keys.
General Comments 0
You need to be logged in to leave comments. Login now