[PATCH 2 of 4 shelve-ext v5] scmutil: make simplekeyvaluefile able to have a non-key-value first line

Yuya Nishihara yuya at tcha.org
Sat May 13 06:33:13 EDT 2017


On Thu, 11 May 2017 14:43:25 -0700, Kostia Balytskyi wrote:
> # HG changeset patch
> # User Kostia Balytskyi <ikostia at fb.com>
> # Date 1494517773 25200
> #      Thu May 11 08:49:33 2017 -0700
> # Node ID b79f27451d7af524c07b89a983cf750bd96292c5
> # Parent  ebf9affb2f7013a6a597ddd0765c786ed36f3722
> scmutil: make simplekeyvaluefile able to have a non-key-value first line

Queued the first two, thanks.

>          try:
>              # the 'if line.strip()' part prevents us from failing on empty
>              # lines which only contain '\n' therefore are not skipped
>              # by 'if line'
> -            d = dict(line[:-1].split('=', 1) for line in lines if line.strip())
> +            update_dict = dict(line[:-1].split('=', 1) for line in lines
> +                                                       if line.strip())

I did s/update_dict/updatedict/ per our coding style.


More information about the Mercurial-devel mailing list