Patchwork config: honour the trusted flag in ui.configint

login
register
mail settings
Submitter Martijn Pieters
Date March 12, 2017, 6:22 a.m.
Message ID <8be2b42b977c09ca7405.1489299723@mjpieters-mbp>
Download mbox | patch
Permalink /patch/19134/
State Changes Requested
Headers show

Comments

Martijn Pieters - March 12, 2017, 6:22 a.m.
# HG changeset patch
# User Martijn Pieters <mjpieters@fb.com>
# Date 1489299699 28800
#      Sat Mar 11 22:21:39 2017 -0800
# Node ID 8be2b42b977c09ca7405dc671e160300a887aa5e
# Parent  abf029200e198878a4576a87e095bd8d77d9cea9
config: honour the trusted flag in ui.configint
Ryan McElroy - March 12, 2017, 6:25 a.m.
On 3/11/17 10:22 PM, Martijn Pieters wrote:
> # HG changeset patch
> # User Martijn Pieters <mjpieters@fb.com>
> # Date 1489299699 28800
> #      Sat Mar 11 22:21:39 2017 -0800
> # Node ID 8be2b42b977c09ca7405dc671e160300a887aa5e
> # Parent  abf029200e198878a4576a87e095bd8d77d9cea9
> config: honour the trusted flag in ui.configint
>
> diff --git a/mercurial/ui.py b/mercurial/ui.py
> --- a/mercurial/ui.py
> +++ b/mercurial/ui.py
> @@ -452,7 +452,7 @@
>           ConfigError: foo.invalid is not a byte quantity ('somevalue')
>           """
>   
> -        value = self.config(section, name)
> +        value = self.config(section, name, None, untrusted)
>           if value is None:
>               if not isinstance(default, str):
>                   return default

Can you add a test please?

Patch

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -452,7 +452,7 @@ 
         ConfigError: foo.invalid is not a byte quantity ('somevalue')
         """
 
-        value = self.config(section, name)
+        value = self.config(section, name, None, untrusted)
         if value is None:
             if not isinstance(default, str):
                 return default