mercurial/vfs.py
changeset 33257 15e9cbe6ae49
parent 33234 b62d13506860
child 33259 6fb5c5096887
equal deleted inserted replaced
33256:4ea0b7a613f9 33257:15e9cbe6ae49
   318         if self.createmode is None or not self._chmod:
   318         if self.createmode is None or not self._chmod:
   319             return
   319             return
   320         os.chmod(name, self.createmode & 0o666)
   320         os.chmod(name, self.createmode & 0o666)
   321 
   321 
   322     def __call__(self, path, mode="r", text=False, atomictemp=False,
   322     def __call__(self, path, mode="r", text=False, atomictemp=False,
   323                  notindexed=False, backgroundclose=False, checkambig=False):
   323                  notindexed=False, backgroundclose=False, checkambig=False,
       
   324                  auditpath=True):
   324         '''Open ``path`` file, which is relative to vfs root.
   325         '''Open ``path`` file, which is relative to vfs root.
   325 
   326 
   326         Newly created directories are marked as "not to be indexed by
   327         Newly created directories are marked as "not to be indexed by
   327         the content indexing service", if ``notindexed`` is specified
   328         the content indexing service", if ``notindexed`` is specified
   328         for "write" mode access.
   329         for "write" mode access.
   342 
   343 
   343         ``checkambig`` argument is passed to atomictemplfile (valid
   344         ``checkambig`` argument is passed to atomictemplfile (valid
   344         only for writing), and is useful only if target file is
   345         only for writing), and is useful only if target file is
   345         guarded by any lock (e.g. repo.lock or repo.wlock).
   346         guarded by any lock (e.g. repo.lock or repo.wlock).
   346         '''
   347         '''
   347         if self._audit:
   348         if auditpath:
   348             r = util.checkosfilename(path)
   349             if self._audit:
   349             if r:
   350                 r = util.checkosfilename(path)
   350                 raise error.Abort("%s: %r" % (r, path))
   351                 if r:
   351         self.audit(path)
   352                     raise error.Abort("%s: %r" % (r, path))
       
   353             self.audit(path)
   352         f = self.join(path)
   354         f = self.join(path)
   353 
   355 
   354         if not text and "b" not in mode:
   356         if not text and "b" not in mode:
   355             mode += "b" # for that other OS
   357             mode += "b" # for that other OS
   356 
   358