# HG changeset patch # User Pierre-Yves David # Date 1488458008 -3600 # Node ID 34d57ddaf9f2fb50f449d5e5e4c4c523c9787e18 # Parent 6d44de27790cdcfa932865590a3f173c9f4aee5c vfs: use 'vfs' module directly in 'test-filecache' Now that the 'vfs' classes moved in their own module, lets use the new module directly. We update code iteratively to help with possible bisect needs in the future. diff -r 6d44de27790c -r 34d57ddaf9f2 tests/test-filecache.py --- a/tests/test-filecache.py Thu Mar 02 13:33:16 2017 +0100 +++ b/tests/test-filecache.py Thu Mar 02 13:33:28 2017 +0100 @@ -13,6 +13,7 @@ scmutil, ui as uimod, util, + vfs as vfsmod, ) filecache = scmutil.filecache @@ -73,7 +74,7 @@ # atomic replace file, size doesn't change # hopefully st_mtime doesn't change as well so this doesn't use the cache # because of inode change - f = scmutil.vfs('.')('x', 'w', atomictemp=True) + f = vfsmod.vfs('.')('x', 'w', atomictemp=True) f.write('b') f.close() @@ -97,7 +98,7 @@ # should recreate the object repo.cached - f = scmutil.vfs('.')('y', 'w', atomictemp=True) + f = vfsmod.vfs('.')('y', 'w', atomictemp=True) f.write('B') f.close() @@ -105,10 +106,10 @@ print("* file y changed inode") repo.cached - f = scmutil.vfs('.')('x', 'w', atomictemp=True) + f = vfsmod.vfs('.')('x', 'w', atomictemp=True) f.write('c') f.close() - f = scmutil.vfs('.')('y', 'w', atomictemp=True) + f = vfsmod.vfs('.')('y', 'w', atomictemp=True) f.write('C') f.close() @@ -200,12 +201,12 @@ # st_mtime is advanced multiple times as expected for i in xrange(repetition): # explicit closing - fp = scmutil.checkambigatclosing(open(filename, 'a')) + fp = vfsmod.checkambigatclosing(open(filename, 'a')) fp.write('FOO') fp.close() # implicit closing by "with" statement - with scmutil.checkambigatclosing(open(filename, 'a')) as fp: + with vfsmod.checkambigatclosing(open(filename, 'a')) as fp: fp.write('BAR') newstat = os.stat(filename)