[PATCH 3 of 3] hook: report untrusted hooks as failure (issue5110) (BC)
Yuya Nishihara
yuya at tcha.org
Fri Apr 15 11:46:45 EDT 2016
On Fri, 15 Apr 2016 00:50:22 -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
> # Date 1460626875 25200
> # Thu Apr 14 02:41:15 2016 -0700
> # Node ID 97b264764e417eefc025b8c7fe298114bde11f1c
> # Parent 41e1d17cdc4943805d5e7a6e7c131367eb94e8d3
> # EXP-Topic hooks
> hook: report untrusted hooks as failure (issue5110) (BC)
The series looks good to me, but I think the nits spotted by Simon are legit.
So I let someone decide to queue these.
> It turned out that the "trusted" concept did not had any ".t" test. The test
> process do not have enough priviledge to change config file ownership. It should
> be possible to implement a devel config option that makes a hgrc file
> untrusted to testing purpose. However, given that the freeze is quite close, I
> wanted this patch out for review quickly. I'll follow up with another series
> installing the test infrastructure for "trusted".
You can fake the trusted flag of repo/.hg/hgrc by extension.
$ cat << EOF > untrustedui.py
> def uisetup(ui):
> class untrustedui(ui.__class__):
> def _trusted(self, fp, f):
> return False # XXX per "f" ?
> return super(untrustedui, self)._trusted(fp, f)
> ui.__class__ = untrustedui
> EOF
This only applies to files loaded without trust=True.
More information about the Mercurial-devel
mailing list