Follow upstream changes -- rest
[git-darcs-import.git] / tests / whatsnew.sh
blobd41f476e733806932450efc996a2cacb0b851501
1 #!/usr/bin/env bash
2 set -ev
4 not () { "$@" && exit 1 || :; }
6 portable_pwd () {
7 if uname | grep -i cygwin > /dev/null; then
8 cygpath -w `pwd`
9 else
10 pwd
14 # Some tests for 'darcs whatsnew '
16 rm -rf temp1 temp2
18 mkdir temp1
19 cd temp1
21 # RT#505 whatsnew -s after removal of file without a newline
22 darcs init
23 echo -n foobar > foo
24 darcs record -la -m "add foo" | grep "Finished record"
25 rm -f foo
26 darcs whatsnew -s | grep R
27 darcs record -a -m "remove foo"
29 # RT#245 --look-for-adds implies --summary
30 touch look_summary.txt
31 darcs whatsnew -l | grep -i "a ./look_summary.txt"
33 #whatsnew works with uncommon file names
34 if echo $OS | grep -i windows; then
35 echo test does not work on windows
36 exit 0;
37 else
38 touch \\
39 darcs add \\
40 darcs whatsnew > log
41 not grep "no changes" log
44 # whatsnew works with absolute paths
45 IFS='' # annoying hack for cygwin and portable_pwd below
46 DIR=`portable_pwd`
47 echo date.t > date.t
48 touch date.t
49 darcs add date.t
50 darcs whatsnew ${DIR}/date.t | grep hunk
52 cd ..
54 rm -rf temp1