[PATCH 1 of 2] templater: remove noop calls of parsestring(s, quoted=False) (API)

Yuya Nishihara yuya at tcha.org
Fri May 8 05:35:04 CDT 2015


On Fri, 08 May 2015 07:35:49 +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1430701263 -32400
> #      Mon May 04 10:01:03 2015 +0900
> # Node ID 700144f73e6b4fef8a8ef77e767572ddb70d3aa6
> # Parent  17ba4ccd20b48511b3d06ab47fb1b2faf31410d7
> templater: remove noop calls of parsestring(s, quoted=False) (API)

> -def parsestring(s, quoted=True):
> -    '''unwrap quotes if quoted is True'''
> -    if quoted:
> -        if len(s) < 2 or s[0] != s[-1]:
> -            raise SyntaxError(_('unmatched quotes'))
> -        return s[1:-1]
> -
> -    return s
> +def parsestring(s):
> +    '''unwrap quotes'''
> +    if len(s) < 2 or s[0] != s[-1]:
> +        raise SyntaxError(_('unmatched quotes'))
> +    return s[1:-1]

This will conflict with the stable patch I've just sent,
"templater: strip single backslash before quotation mark in quoted template."


More information about the Mercurial-devel mailing list