[PATCH] transplant: Add trailing CR in tmp file for filtering

Sune Foldager cryo at cyanite.org
Thu Sep 10 01:15:01 CDT 2009


Assuming from the code that you mean NL and not CR (\r). It's mostly  
on Windows that we need to deal with the latter :-/

-- Sune

On 10/09/2009, at 01.56, Mads Kiilerich <mads at kiilerich.com> wrote:

> # HG changeset patch
> # User Mads Kiilerich <mads at kiilerich.com>
> # Date 1252540585 -7200
> # Node ID 674352c63cffacd91fcd1eaf63bdf173b59f1e6c
> # Parent  fef209e657579ddd0b87ed728f1fee8912960eab
> transplant: Add trailing CR in tmp file for filtering
>
> Transplant filtering used a tmp file ending with the (stripped)  
> commit message
> and thus no final CR. Text files not ending with CR is usually not  
> used on Unix
> and is thus wrong ;-)
>
> The missing CR had bad consequences because Solaris sed chokes on  
> unterminated
> input lines, so
>  echo -n foo|sed 's,o,0,g'
> doesn't output anything, and the filter used in tests/test- 
> transplant thus
> stripped the last (and only) line in the message away on solaris.
>
> diff --git a/hgext/transplant.py b/hgext/transplant.py
> --- a/hgext/transplant.py
> +++ b/hgext/transplant.py
> @@ -182,7 +182,7 @@
>         fp.write("# HG changeset patch\n")
>         fp.write("# User %s\n" % user)
>         fp.write("# Date %d %d\n" % date)
> -        fp.write(changelog[4])
> +        fp.write(msg + '\n')
>         fp.close()
>
>         try:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list