[PATCH] keyword: cleanup test and make it portable

Christian Ebert blacktrash at gmx.net
Sat May 1 16:12:06 CDT 2010


* Matt Mackall on Saturday, May 01, 2010 at 14:28:39 -0500
> On Sat, 2010-05-01 at 20:49 +0200, Christian Ebert wrote:
>> # HG changeset patch
>> # User Christian Ebert <blacktrash at gmx.net>
>> # Date 1272739780 -7200
>> # Node ID c8bf0fbd4456b9ba9cc2b642124e9c0cda50d150
>> # Parent  f6dcbeb5babe7278531e127b91c55f2d94a0c8b9
>> keyword: cleanup test and make it portable
>> 
>> - replace sed call with python command
>> - no need to back up hgrc before record
> 
> Queued, thanks.

As David Champion said, this could also be done by:

awk '{print} NR==1 {print "foo"} END {print "bar"}' a >a.tmp
mv a.tmp a

which might be just a bit faster. In case you prefer the awk-ward
way, just let me know.

c
-- 
theatre - books - texts - movies
Black Trash Productions at home: http://www.blacktrash.org/
Black Trash Productions on Facebook:
http://www.facebook.com/blacktrashproductions


More information about the Mercurial-devel mailing list