Skip to content
Snippets Groups Projects
Commit 900767df authored by Katsunori FUJIWARA's avatar Katsunori FUJIWARA
Browse files

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.
parent 7c76587f
No related branches found
No related tags found
No related merge requests found
......@@ -519,7 +519,10 @@
$ 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,8 +1499,9 @@
(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
......@@ -1500,8 +1504,9 @@
$ 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()'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment