# HG changeset patch # User Pierre-Yves David # Date 1500954704 -7200 # Node ID 0fd701dbfcc65e46d51a1004f5f6735b8c5cea73 # Parent 0dc119ed06b45bcab8fa37bc5226947702a2c72b compat: handle pre-4.2 compatibility for accessing vfs The vfs module is quite new. diff -r 0dc119ed06b4 -r 0fd701dbfcc6 hgext3rd/evolve/obscache.py --- 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