[PATCH 2 of 9] heredoctest: do not append extra newline character to continuation line

Idan Kamara idankk86 at gmail.com
Sun Sep 28 14:44:21 CDT 2014


On Sun, Sep 28, 2014 at 8:32 AM, Yuya Nishihara <yuya at tcha.org> wrote:
>
> (resend with CC to mercurial-devel)
>
> On Sun, 28 Sep 2014 17:18:24 +0200, Mads Kiilerich wrote:
> > On 09/28/2014 04:17 PM, Yuya Nishihara wrote:
> > > # HG changeset patch
> > > # User Yuya Nishihara <yuya at tcha.org>
> > > # Date 1411884815 -32400
> > > #      Sun Sep 28 15:13:35 2014 +0900
> > > # Node ID b665907351a96e88e84841fd97b9ddceec9c476e
> > > # Parent  62ea66130006851da1973c55c6bfcb5bfbb7f856
> > > heredoctest: do not append extra newline character to continuation line
> > >
> > > Trailing newline characters are kept in lines.
> >
> > In which cases will this make a difference? When was the extra newline
> > shown?
>
> The following code in PATCH 5 didn't work because patch content was corrupted
> by extra newlines.
>
> +  ...     patch = """
> +  ... # HG changeset patch
> +  ... # User test
> +  ... # Date 0 0
> +  ... # Node ID c103a3dec114d882c98382d684d8af798d09d857
> +  ... # Parent  0000000000000000000000000000000000000000
> +  ... 1
> +  ...
> +  ... diff -r 000000000000 -r c103a3dec114 a
> +  ... --- /dev/null    Thu Jan 01 00:00:00 1970 +0000
> +  ... +++ b/a  Thu Jan 01 00:00:00 1970 +0000
> +  ... @@ -0,0 +1,1 @@
> +  ... +1
> +  ... """
> +  ...     runcommand(server, ['import', '-'], input=cStringIO.StringIO(patch))

Might be worth to add a small test for heredoctest.py as you fixed two
bugs in this series.


More information about the Mercurial-devel mailing list