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

Christian Ebert blacktrash at gmx.net
Fri Feb 3 19:08:09 UTC 2012


* 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()'



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