File: incremental.sh

package info (click to toggle)
cvs-fast-export 1.59-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 5,960 kB
  • sloc: ansic: 5,743; python: 1,391; sh: 532; lex: 352; yacc: 273; makefile: 249; perl: 99
file content (34 lines) | stat: -rwxr-xr-x 837 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
## Test commit and blob filtering with --
out="/tmp/incremental-out-$$"
while getopts os opt
do
    case $opt in
	o) out=/dev/stdout;;
	s) opts="-t 0";;
	*) echo "$0: unknown option $opt" ;;
    esac
done
# shellcheck disable=SC2004
shift $(($OPTIND - 1))

trap '[ $out != /dev/stdout ] && rm -f $out' EXIT HUP INT QUIT TERM

# shellcheck disable=SC2006
idate=$(date -u -d"`rlog -r1.1.2.2 twobranch.repo/module/README,v | grep date | sed "s/date: \(.*\)\;  author.*/\1/"`" +%s)
# shellcheck disable=SC2003,SC2046,SC2086
find twobranch.repo/ -name "*,v" | cvs-fast-export $opts -i $(expr $idate - 1) >$out

if [ "$out" != /dev/stdout ]
then
    # :7 and :9 are the blobs attached to the selected commits
    if grep -q ":7" $out && grep -q ":9" $out
    then
	echo "ok - $0"
    else
	echo "not ok - $0"
	exit 1
    fi
fi

#end