changeset 2796:0fd701dbfcc6

compat: handle pre-4.2 compatibility for accessing vfs The vfs module is quite new.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 25 Jul 2017 05:51:44 +0200
parents 0dc119ed06b4
children 74456bc055ae e453fc535094
files hgext3rd/evolve/obscache.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/obscache.py	Tue Jul 25 05:14:37 2017 +0200
+++ b/hgext3rd/evolve/obscache.py	Tue Jul 25 05:51:44 2017 +0200
@@ -22,7 +22,6 @@
     pycompat,
     node,
     util,
-    vfs as vfsmod,
 )
 
 from mercurial.i18n import _
@@ -43,6 +42,12 @@
 else:
     timer = time.time
 
+# hg < 4.2 compat
+try:
+    from mercurial import vfs as vfsmod
+    vfsmod.vfs
+except ImportError:
+    from mercurial import scmutil as vfsmod
 
 try:
     obsstorefilecache = localrepo.localrepository.obsstore