comparison mercurial/scmutil.py @ 31951:f23d579a5a04

vfs: deprecate all old classes in scmutil Now that all vfs class moved to the vfs module, we can deprecate the old one.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 03 Apr 2017 14:21:38 +0200
parents 0f8ba0bc1154
children 38963a53ab0d
comparison
equal deleted inserted replaced
31950:cc70c6dbac30 31951:f23d579a5a04
327 for rev in revs: 327 for rev in revs:
328 s.update('%d;' % rev) 328 s.update('%d;' % rev)
329 key = s.digest() 329 key = s.digest()
330 return key 330 return key
331 331
332 def _deprecated(old, new, func):
333 msg = ('class at mercurial.scmutil.%s moved to mercurial.vfs.%s'
334 % (old, new))
335 def wrapper(*args, **kwargs):
336 util.nouideprecwarn(msg, '4.2')
337 return func(*args, **kwargs)
338 return wrapper
339
332 # compatibility layer since all 'vfs' code moved to 'mercurial.vfs' 340 # compatibility layer since all 'vfs' code moved to 'mercurial.vfs'
333 # 341 #
334 # This is hard to instal deprecation warning to this since we do not have 342 # This is hard to instal deprecation warning to this since we do not have
335 # access to a 'ui' object. 343 # access to a 'ui' object.
336 opener = vfs = vfsmod.vfs 344 opener = _deprecated('opener', 'vfs', vfsmod.vfs)
337 filteropener = filtervfs = vfsmod.filtervfs 345 vfs = _deprecated('vfs', 'vfs', vfsmod.vfs)
338 abstractvfs = vfsmod.abstractvfs 346 filteropener = _deprecated('filteropener', 'filtervfs', vfsmod.filtervfs)
339 readonlyvfs = vfsmod.readonlyvfs 347 filtervfs = _deprecated('filtervfs', 'filtervfs', vfsmod.filtervfs)
340 auditvfs = vfsmod.auditvfs 348 abstractvfs = _deprecated('abstractvfs', 'abstractvfs', vfsmod.abstractvfs)
349 readonlyvfs = _deprecated('readonlyvfs', 'readonlyvfs', vfsmod.readonlyvfs)
350 auditvfs = _deprecated('auditvfs', 'auditvfs', vfsmod.auditvfs)
341 checkambigatclosing = vfsmod.checkambigatclosing 351 checkambigatclosing = vfsmod.checkambigatclosing
342 352
343 def walkrepos(path, followsym=False, seen_dirs=None, recurse=False): 353 def walkrepos(path, followsym=False, seen_dirs=None, recurse=False):
344 '''yield every hg repository under path, always recursively. 354 '''yield every hg repository under path, always recursively.
345 The recurse flag will only control recursion into repo working dirs''' 355 The recurse flag will only control recursion into repo working dirs'''
958 e = "invalid value in a simple key-value file" 968 e = "invalid value in a simple key-value file"
959 raise error.ProgrammingError(e) 969 raise error.ProgrammingError(e)
960 lines.append("%s=%s\n" % (k, v)) 970 lines.append("%s=%s\n" % (k, v))
961 with self.vfs(self.path, mode='wb', atomictemp=True) as fp: 971 with self.vfs(self.path, mode='wb', atomictemp=True) as fp:
962 fp.write(''.join(lines)) 972 fp.write(''.join(lines))
963