Mercurial > public > mercurial-scm > hg
comparison mercurial/scmutil.py @ 32115:ef966bcf48a5
cleanup: drop vfs compatibility layer in scmutil
All these constructors are deprecated in 4.2. We can now drop them on the
default branch (future 4.3).
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Tue, 02 May 2017 01:59:33 +0200 |
parents | 1208b74841ff |
children | 994b0b1c77d6 |
comparison
equal
deleted
inserted
replaced
32114:44a98a2ea431 | 32115:ef966bcf48a5 |
---|---|
24 phases, | 24 phases, |
25 pycompat, | 25 pycompat, |
26 revsetlang, | 26 revsetlang, |
27 similar, | 27 similar, |
28 util, | 28 util, |
29 vfs as vfsmod, | |
30 ) | 29 ) |
31 | 30 |
32 if pycompat.osname == 'nt': | 31 if pycompat.osname == 'nt': |
33 from . import scmwindows as scmplatform | 32 from . import scmwindows as scmplatform |
34 else: | 33 else: |
331 for rev in revs: | 330 for rev in revs: |
332 s.update('%d;' % rev) | 331 s.update('%d;' % rev) |
333 key = s.digest() | 332 key = s.digest() |
334 return key | 333 return key |
335 | 334 |
336 def _deprecated(old, new, func): | |
337 msg = ('class at mercurial.scmutil.%s moved to mercurial.vfs.%s' | |
338 % (old, new)) | |
339 def wrapper(*args, **kwargs): | |
340 util.nouideprecwarn(msg, '4.2') | |
341 return func(*args, **kwargs) | |
342 return wrapper | |
343 | |
344 # compatibility layer since all 'vfs' code moved to 'mercurial.vfs' | |
345 # | |
346 # This is hard to instal deprecation warning to this since we do not have | |
347 # access to a 'ui' object. | |
348 opener = _deprecated('opener', 'vfs', vfsmod.vfs) | |
349 vfs = _deprecated('vfs', 'vfs', vfsmod.vfs) | |
350 filteropener = _deprecated('filteropener', 'filtervfs', vfsmod.filtervfs) | |
351 filtervfs = _deprecated('filtervfs', 'filtervfs', vfsmod.filtervfs) | |
352 abstractvfs = _deprecated('abstractvfs', 'abstractvfs', vfsmod.abstractvfs) | |
353 readonlyvfs = _deprecated('readonlyvfs', 'readonlyvfs', vfsmod.readonlyvfs) | |
354 auditvfs = _deprecated('auditvfs', 'auditvfs', vfsmod.auditvfs) | |
355 checkambigatclosing = vfsmod.checkambigatclosing | |
356 | |
357 def walkrepos(path, followsym=False, seen_dirs=None, recurse=False): | 335 def walkrepos(path, followsym=False, seen_dirs=None, recurse=False): |
358 '''yield every hg repository under path, always recursively. | 336 '''yield every hg repository under path, always recursively. |
359 The recurse flag will only control recursion into repo working dirs''' | 337 The recurse flag will only control recursion into repo working dirs''' |
360 def errhandler(err): | 338 def errhandler(err): |
361 if err.filename == path: | 339 if err.filename == path: |