# HG changeset patch # User FUJIWARA Katsunori # Date 2012-04-01 09:18:48 # Node ID 900767dfa80d417f00646bf79d2ef049322503b3 # Parent 7c76587fb3726e9ac7da5346e828313c6119f1d7 tests: fix portability of sed usage in test-mq on some platform (Mac OS X and Solaris, at least), to insert new text line, sed function 'i' should be followed by: - backslash('\'), - new-line, - text to be inserted and - new-line GNU sed on Linux can recognize both previous and new ones as same modification request. in addition to it, this patch avoids to use '-i' option for sed, because it is not so portable, as noted in WritingTests wiki page. diff --git a/tests/test-mq.t b/tests/test-mq.t --- a/tests/test-mq.t +++ b/tests/test-mq.t @@ -519,7 +519,10 @@ cleaning up $ hg qpush --move test.patch # already applied abort: cannot push to a previous patch: test.patch [255] - $ sed -i.bak '2i\# make qtip index different in series and fullseries' `hg root`/.hg/patches/series + $ sed '2i\ + > # make qtip index different in series and fullseries + > ' `hg root`/.hg/patches/series > $TESTTMP/sedtmp + $ cp $TESTTMP/sedtmp `hg root`/.hg/patches/series $ cat `hg root`/.hg/patches/series # comment # make qtip index different in series and fullseries @@ -1496,12 +1499,14 @@ Test that qfinish respect phases.new-com (restore env for next test) - $ sed -i.bak -e 's/new-commit=secret//' $HGRCPATH + $ sed -e 's/new-commit=secret//' $HGRCPATH > $TESTTMP/sedtmp + $ cp $TESTTMP/sedtmp $HGRCPATH $ hg qimport -r 1 --name add-file2 Test that qfinish preserve phase when mq.secret=false - $ sed -i.bak -e 's/secret=true/secret=false/' $HGRCPATH + $ sed -e 's/secret=true/secret=false/' $HGRCPATH > $TESTTMP/sedtmp + $ cp $TESTTMP/sedtmp $HGRCPATH $ hg qfinish qbase patch add-file2 finalized without changeset message $ hg phase 'all()'