[PATCH STABLE] test-mq: fix sed call on OSX

Christian Ebert blacktrash at gmx.net
Fri Feb 3 14:15:21 CST 2012


* Patrick Mézard on Friday, February 03, 2012 at 20:23:24 +0100
> Le 03/02/12 20:08, Christian Ebert a écrit :
>> * Patrick Mezard on Friday, February 03, 2012 at 19:45:29 +0100
>>> # HG changeset patch
>>> # User Patrick Mezard <pmezard at gmail.com>
>>> # Date 1328293393 -3600
>>> # Branch stable
>>> # Node ID 3b9c18ed998553ab19321e1c8b852fa6b76eac13
>>> # Parent  0620421044a2bcaafd054a6ee454614888699de8
>>> test-mq: fix sed call on OSX
>>> 
>>> - The regular sed on OSX wants: -i "" not -i""
>>> - GNU sed wants: -i"" not -i ""
>>> 
>>> Backups are fine.
>> 
>> With heredoc syntax the sed call can be avoided althogether:
>> 
>> diff --git a/tests/test-mq.t b/tests/test-mq.t
>> --- a/tests/test-mq.t
>> +++ b/tests/test-mq.t
>> @@ -1476,7 +1476,10 @@
>> 
>> Test that qfinish preserve phase when mq.secret=false
>> 
>> -  $ sed -i'' $HGRCPATH -e 's/secret=true/secret=false/'
>> +  >>> import os
>> +  >>> hgrcpath = os.getenv('HGRCPATH')
>> +  >>> text = open(hgrcpath).read()
>> +  >>> open(hgrcpath, 'w').write(text.replace('secret=true', 'secret=false'))
>>   $ hg qfinish qbase
>>   patch add-file2 finalized without changeset message
>>   $ hg phase 'all()'
> 
> Hey thanks, I was not aware run-test.py supported this.

http://selenic.com/hg/rev/4fae5df4b1bb ff.

> I considered using inline python with -c, but honestly...
> backups are fine.

;-)

c
-- 
  Was heißt hier Dogma, ich bin Underdogma!
[ What the hell do you mean dogma, I am underdogma. ]
free movies       --->>> http://www.blacktrash.org/underdogma
http://itunes.apple.com/podcast/underdogma-movies/id363423596


More information about the Mercurial-devel mailing list