comparison mercurial/pathutil.py @ 33435:456626e9c3d1

vfs: allow to pass more argument to audit We want to be able to do more precise check when auditing a path depending of the intend of the file access (eg read versus write). So we now pass the 'mode' value to 'audit' and update the audit function to accept them. This will be put to use in the next changeset.
author Boris Feld <boris.feld@octobus.net>
date Tue, 11 Jul 2017 12:27:58 +0200
parents cfe66dcf45c0
children 377e8ddaebef
comparison
equal deleted inserted replaced
33434:9212fd003993 33435:456626e9c3d1
44 if os.path.lexists(root) and not util.fscasesensitive(root): 44 if os.path.lexists(root) and not util.fscasesensitive(root):
45 self.normcase = util.normcase 45 self.normcase = util.normcase
46 else: 46 else:
47 self.normcase = lambda x: x 47 self.normcase = lambda x: x
48 48
49 def __call__(self, path): 49 def __call__(self, path, mode=None):
50 '''Check the relative path. 50 '''Check the relative path.
51 path may contain a pattern (e.g. foodir/**.txt)''' 51 path may contain a pattern (e.g. foodir/**.txt)'''
52 52
53 path = util.localpath(path) 53 path = util.localpath(path)
54 normpath = self.normcase(path) 54 normpath = self.normcase(path)