changeset 2244:c7da63d48f80

compat: work around some filecache bug in 3.8 We are still compatible with this version.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sun, 26 Mar 2017 04:59:36 +0200
parents d83851f2d375
children a14e05e4bb20
files hgext3rd/evolve/obsdiscovery.py
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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())