comparison tests/test-mq.t @ 16331:900767dfa80d stable

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.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sun, 01 Apr 2012 18:18:48 +0900
parents 7c76587fb372
children 41b41adba08a
comparison
equal deleted inserted replaced
16327:7c76587fb372 16331:900767dfa80d
517 abort: please specify the patch to move 517 abort: please specify the patch to move
518 [255] 518 [255]
519 $ hg qpush --move test.patch # already applied 519 $ hg qpush --move test.patch # already applied
520 abort: cannot push to a previous patch: test.patch 520 abort: cannot push to a previous patch: test.patch
521 [255] 521 [255]
522 $ sed -i.bak '2i\# make qtip index different in series and fullseries' `hg root`/.hg/patches/series 522 $ sed '2i\
523 > # make qtip index different in series and fullseries
524 > ' `hg root`/.hg/patches/series > $TESTTMP/sedtmp
525 $ cp $TESTTMP/sedtmp `hg root`/.hg/patches/series
523 $ cat `hg root`/.hg/patches/series 526 $ cat `hg root`/.hg/patches/series
524 # comment 527 # comment
525 # make qtip index different in series and fullseries 528 # make qtip index different in series and fullseries
526 529
527 test.patch 530 test.patch
1494 1: secret 1497 1: secret
1495 2: secret 1498 2: secret
1496 1499
1497 (restore env for next test) 1500 (restore env for next test)
1498 1501
1499 $ sed -i.bak -e 's/new-commit=secret//' $HGRCPATH 1502 $ sed -e 's/new-commit=secret//' $HGRCPATH > $TESTTMP/sedtmp
1503 $ cp $TESTTMP/sedtmp $HGRCPATH
1500 $ hg qimport -r 1 --name add-file2 1504 $ hg qimport -r 1 --name add-file2
1501 1505
1502 Test that qfinish preserve phase when mq.secret=false 1506 Test that qfinish preserve phase when mq.secret=false
1503 1507
1504 $ sed -i.bak -e 's/secret=true/secret=false/' $HGRCPATH 1508 $ sed -e 's/secret=true/secret=false/' $HGRCPATH > $TESTTMP/sedtmp
1509 $ cp $TESTTMP/sedtmp $HGRCPATH
1505 $ hg qfinish qbase 1510 $ hg qfinish qbase
1506 patch add-file2 finalized without changeset message 1511 patch add-file2 finalized without changeset message
1507 $ hg phase 'all()' 1512 $ hg phase 'all()'
1508 0: draft 1513 0: draft
1509 1: secret 1514 1: secret