compat: work around some filecache bug in 3.8
We are still compatible with this version.
--- a/hgext3rd/evolve/obsdiscovery.py Fri Mar 24 18:21:48 2017 +0100
+++ b/hgext3rd/evolve/obsdiscovery.py Sun Mar 26 04:59:36 2017 +0200
@@ -525,8 +525,19 @@
obsstore.rangeobshashcache.clear()
return orig(obsstore, *args, **kwargs)
+try:
+ obsstorefilecache = localrepo.localrepository.obsstore
+except AttributeError:
+ # XXX hg-3.8 compat
+ #
+ # mercurial 3.8 has issue with accessing file cache property from their
+ # cache. This is fix by 36fbd72c2f39fef8ad52d7c559906c2bc388760c in core
+ # and shipped in 3.9
+ obsstorefilecache = localrepo.localrepository.__dict__['obsstore']
+
+
# obsstore is a filecache so we have do to some spacial dancing
-@eh.wrapfunction(localrepo.localrepository.obsstore, 'func')
+@eh.wrapfunction(obsstorefilecache, 'func')
def obsstorewithcache(orig, repo):
obsstore = orig(repo)
obsstore.rangeobshashcache = _obshashcache(repo.unfiltered())