Patchwork [10,of,14] openrevlog: manually lift path auditing

login
register
mail settings
Submitter Pierre-Yves David
Date July 2, 2017, 2:56 a.m.
Message ID <a5ddf792663096dbc146.1498964195@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/21884/
State Accepted
Headers show

Comments

Pierre-Yves David - July 2, 2017, 2:56 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1498957810 -7200
#      Sun Jul 02 03:10:10 2017 +0200
# Node ID a5ddf792663096dbc14607616232081c5eadd8e7
# Parent  d15514b41d39ddf23018787f5946f1df85458eaf
# 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 a5ddf7926630
openrevlog: manually lift path auditing

This is the last user of 'audit=False' for vfs. Since this function is only used
by the perf extensions and a handful debug commands, it seems sane to add one
line of extra logic here and simplify the vfs code.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -691,8 +691,9 @@  def openrevlog(repo, cmd, file_, opts):
             raise error.CommandError(cmd, _('invalid arguments'))
         if not os.path.isfile(file_):
             raise error.Abort(_("revlog '%s' not found") % file_)
-        r = revlog.revlog(vfsmod.vfs(pycompat.getcwd(), audit=False),
-                          file_[:-2] + ".i")
+        vfs = vfsmod.vfs(pycompat.getcwd())
+        vfs.audit = util.always # disable path auditing
+        r = revlog.revlog(vfs, file_[:-2] + ".i")
     return r
 
 def copy(ui, repo, pats, opts, rename=False):