##// END OF EJS Templates
revlog: do not call Rust code if the index is not compatible with it...
marmoute -
r48043:6be2a7ca default
parent child Browse files
Show More
@@ -1063,7 +1063,7 b' class revlog(object):'
1063 checkrev(r)
1063 checkrev(r)
1064 # and we're sure ancestors aren't filtered as well
1064 # and we're sure ancestors aren't filtered as well
1065
1065
1066 if rustancestor is not None:
1066 if rustancestor is not None and self.index.rust_ext_compat:
1067 lazyancestors = rustancestor.LazyAncestors
1067 lazyancestors = rustancestor.LazyAncestors
1068 arg = self.index
1068 arg = self.index
1069 else:
1069 else:
@@ -1150,7 +1150,7 b' class revlog(object):'
1150 if common is None:
1150 if common is None:
1151 common = [nullrev]
1151 common = [nullrev]
1152
1152
1153 if rustancestor is not None:
1153 if rustancestor is not None and self.index.rust_ext_compat:
1154 return rustancestor.MissingAncestors(self.index, common)
1154 return rustancestor.MissingAncestors(self.index, common)
1155 return ancestor.incrementalmissingancestors(self.parentrevs, common)
1155 return ancestor.incrementalmissingancestors(self.parentrevs, common)
1156
1156
@@ -1370,7 +1370,7 b' class revlog(object):'
1370 return self.index.headrevs()
1370 return self.index.headrevs()
1371 except AttributeError:
1371 except AttributeError:
1372 return self._headrevs()
1372 return self._headrevs()
1373 if rustdagop is not None:
1373 if rustdagop is not None and self.index.rust_ext_compat:
1374 return rustdagop.headrevs(self.index, revs)
1374 return rustdagop.headrevs(self.index, revs)
1375 return dagop.headrevs(revs, self._uncheckedparentrevs)
1375 return dagop.headrevs(revs, self._uncheckedparentrevs)
1376
1376
@@ -274,6 +274,8 b' class partialdiscovery(object):'
274 return sample
274 return sample
275
275
276
276
277 pure_partialdiscovery = partialdiscovery
278
277 partialdiscovery = policy.importrust(
279 partialdiscovery = policy.importrust(
278 'discovery', member='PartialDiscovery', default=partialdiscovery
280 'discovery', member='PartialDiscovery', default=partialdiscovery
279 )
281 )
@@ -434,9 +436,11 b' def findcommonheads('
434 hard_limit_sample = not (dynamic_sample or remote.limitedarguments)
436 hard_limit_sample = not (dynamic_sample or remote.limitedarguments)
435
437
436 randomize = ui.configbool(b'devel', b'discovery.randomize')
438 randomize = ui.configbool(b'devel', b'discovery.randomize')
437 disco = partialdiscovery(
439 if cl.index.rust_ext_compat:
438 local, ownheads, hard_limit_sample, randomize=randomize
440 pd = partialdiscovery
439 )
441 else:
442 pd = pure_partialdiscovery
443 disco = pd(local, ownheads, hard_limit_sample, randomize=randomize)
440 if initial_head_exchange:
444 if initial_head_exchange:
441 # treat remote heads (and maybe own heads) as a first implicit sample
445 # treat remote heads (and maybe own heads) as a first implicit sample
442 # response
446 # response
General Comments 0
You need to be logged in to leave comments. Login now