[prev in list] [next in list] [prev in thread] [next in thread]
List: mercurial-devel
Subject: Re: [PATCH FOLLOWUP STABLE] commitextras: make sure keys contains ascii letters, numbers, '_' and '-
From: Yuya Nishihara <yuya () tcha ! org>
Date: 2017-07-29 13:04:26
Message-ID: 20170729220426.d45a236d025e071dca08081b () tcha ! org
[Download RAW message or body]
On Fri, 28 Jul 2017 08:37:33 -0700, Martin von Zweigbergk via Mercurial-devel wrote:
> On Fri, Jul 28, 2017 at 7:20 AM, Pulkit Goyal <7895pulkit@gmail.com> wrote:
> > # HG changeset patch
> > # User Pulkit Goyal <7895pulkit@gmail.com>
> > # Date 1501207975 -19800
> > # Fri Jul 28 07:42:55 2017 +0530
> > # Branch stable
> > # Node ID 2545b963f05a731d51f632bdb0572a755e80eca5
> > # Parent 850d2ec2cf6a266987a401752c909f95dd8c4c53
> > commitextras: make sure keys contains ascii letters, numbers, '_' and '-' only
>
> Why is that important? Are stored as is in the changeset data so they
> can make it unparseable?
':' and 8-bit characters have a real problem. ':' is a key-value separator,
and extras are stored without encoding conversion. The other characters are
probably okay, but I don't think it's good idea to allow free-form keys.
We can relax the restriction later, but tightening it wouldn't be easy.
> > + if re.match('[\w-]+', k).group() != k:
Common regex idiom is finding bad characters.
re.search('[^\w-]', k)
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic