4 # Some tests for the '--match' flag
6 not
() { "$@" && exit 1 ||
:; }
8 # set up the repository
9 rm -rf temp1
# another script may have left a mess.
15 # create three patches - the property we exploit to determine
16 # if a matcher does the right thing is that each patch has a
21 darcs record
-a -m "first patch" bar
-A author1
23 darcs record
-a -m "\"second\" \\ patch" bar
-A author2
25 darcs record
-a -m "second" bar
-A author3
28 # -------------------------------------------------------------------
30 # -------------------------------------------------------------------
33 # matching on author really matches on that, and not something else
34 darcs changes
--match='author "first patch"' > log
36 # normal changes shows both authors and patch names
41 grep 'first patch' log
42 grep '"second" \\ patch' log
43 grep -v patch log |
grep second
45 darcs changes
--match='exact second' > log
50 darcs changes
--match='name second' > log
55 darcs changes
--match='author author1' > log
60 darcs changes
--xml-output --match='exact "\"second\" \ patch"' > log
61 hash=`grep hash log | sed -e "s/.*hash='//" -e "s/'.*//"`
63 darcs changes
--match="hash $hash"
69 # -------------------------------------------------------------------
70 # matching on combinations
72 # uses the setup from the atomic patches
73 # -------------------------------------------------------------------
77 darcs changes
--match='author author1 || author author2' > log
82 darcs changes
--match='name second && author author2' > log
87 darcs changes
--match='not name second' > log
92 darcs changes
--match='(not name second) || (author author3)' > log