[PATCH 08 of 14] undumprevlog: manually lift path auditing

Yuya Nishihara yuya at tcha.org
Wed Jul 5 10:39:45 EDT 2017


On Sun, 02 Jul 2017 04:56:33 +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at octobus.net>
> # Date 1498960272 -7200
> #      Sun Jul 02 03:51:12 2017 +0200
> # Node ID 5dd9c2cb6d1dbebc0a51662dd8dda9d4c3f933db
> # Parent  aa8fda090eeee63cfc24d4a125d69f275abac1dd
> # EXP-Topic vfs.ward
> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 5dd9c2cb6d1d
> undumprevlog: manually lift path auditing
> 
> The 'audit' parameter of 'vfs' has very few users (three) and None of them are
> from official commands. We start using alternative approach to be eventually
> able of dropping the parameters.
> 
> diff --git a/contrib/undumprevlog b/contrib/undumprevlog
> --- a/contrib/undumprevlog
> +++ b/contrib/undumprevlog
> @@ -17,7 +17,8 @@ from mercurial import (
>  for fp in (sys.stdin, sys.stdout, sys.stderr):
>      util.setbinary(fp)
>  
> -opener = vfsmod.vfs('.', False)
> +opener = vfsmod.vfs('.')
> +opener.audit = lambda fn: True # disable path auditing

I don't think replacing the audit function is better than the audit flag.
Also, util.checkosfilename() was guarded by self._audit, which is no longer
be disabled.


More information about the Mercurial-devel mailing list