From f814ae9ab30a60da09070294e5a39cc4c095f3b5 Mon Sep 17 00:00:00 2001 From: Brendan Cully Date: Wed, 16 Aug 2006 19:50:21 -0700 Subject: [PATCH] sed portability fixes --- tests/README | 6 +++--- tests/test-git-export | 18 ++++++++++++------ tests/test-mq | 6 ++++-- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/tests/README b/tests/README index 9b3b911710..f16c2f67aa 100644 --- a/tests/README +++ b/tests/README @@ -28,6 +28,6 @@ writing tests: - diff will show the current time - use hg diff | sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/" to strip - dates - + use hg diff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ + -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" + to strip dates diff --git a/tests/test-git-export b/tests/test-git-export index 24138ea56f..7949f4a74b 100755 --- a/tests/test-git-export +++ b/tests/test-git-export @@ -8,22 +8,26 @@ hg ci -Amstart -d '0 0' echo new > new hg ci -Amnew -d '0 0' echo '% new file' -hg diff --git -r 0 | sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/" +hg diff --git -r 0 | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ + -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" hg cp new copy hg ci -mcopy -d '0 0' echo '% copy' -hg diff --git -r 1:tip | sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/" +hg diff --git -r 1:tip | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ + -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" hg mv copy rename hg ci -mrename -d '0 0' echo '% rename' -hg diff --git -r 2:tip | sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/" +hg diff --git -r 2:tip | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ + -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" hg rm rename hg ci -mdelete -d '0 0' echo '% delete' -hg diff --git -r 3:tip | sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/" +hg diff --git -r 3:tip | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ + -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" cat > src <> dst hg ci -mrenamemod -d '0 0' echo '% rename+mod+chmod' -hg diff --git -r 6:tip | sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/" +hg diff --git -r 6:tip | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ + -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" diff --git a/tests/test-mq b/tests/test-mq index 135c1c37fc..b5bc71ef05 100755 --- a/tests/test-mq +++ b/tests/test-mq @@ -141,12 +141,14 @@ echo foo > new chmod +x new hg add new hg qrefresh -sed -e "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/new +sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ + -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/new hg qnew -m'copy file' copy hg cp new copy hg qrefresh -sed -e "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/copy +sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ + -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/copy hg qpop hg qpush