DarcsWeeklyNews/tools/createstub.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

if [ $# -ne 0 ]; then
  echo "This script doesn't take any arguments"
  exit 1
fi

if [ ! -e lastchange ]; then
  echo "Please create a file 'lastchange' containing the short name of" 1>&2
  echo "last weeks' most recent patch" 1>&2
  exit 1
fi

rm -f lastchange.old
cp lastchange lastchange.old
darcsdir=http://darcs.net/reviewed
cat template > stub
darcs changes --from-patch "`cat lastchange`" --xml --repo ${darcsdir} | ./parsechanges >> stub
darcs changes --last=1 --xml --repo ${darcsdir} | grep name | sed -e 's/.*<name>//' -e 's!</name>.*!!' > lastchange

cat stub
echo "I have also saved this to 'stub' and updated 'lastchange'" 1>&2