| 1 | #!/bin/sh |
| 2 | ## Test commit and blob filtering with -- |
| 3 | out="/tmp/incremental-out-$$" |
| 4 | while getopts os opt |
| 5 | do |
| 6 | case $opt in |
| 7 | o) out=/dev/stdout;; |
| 8 | s) opts="-t 0";; |
| 9 | *) echo "$0: unknown option $opt" ;; |
| 10 | esac |
| 11 | done |
| 12 | # shellcheck disable=SC2004 |
| 13 | shift $(($OPTIND - 1)) |
| 14 | |
| 15 | trap '[ $out != /dev/stdout ] && rm -f $out' EXIT HUP INT QUIT TERM |
| 16 | |
| 17 | # shellcheck disable=SC2006 |
| 18 | idate=$(date -u -d"`rlog -r1.1.2.2 twobranch.repo/module/README,v | grep date | sed "s/date: \(.*\)\; author.*/\1/"`" +%s) |
| 19 | # shellcheck disable=SC2003,SC2046,SC2086 |
| 20 | find twobranch.repo/ -name "*,v" | cvs-fast-export $opts -i $(expr $idate - 1) >$out |
| 21 | |
| 22 | if [ "$out" != /dev/stdout ] |
| 23 | then |
| 24 | # :7 and :9 are the blobs attached to the selected commits |
| 25 | if grep -q ":7" $out && grep -q ":9" $out |
| 26 | then |
| 27 | echo "ok - $0" |
| 28 | else |
| 29 | echo "not ok - $0" |
| 30 | exit 1 |
| 31 | fi |
| 32 | fi |
| 33 | |
| 34 | #end |