some LCARStrek polish: throbber should look like a normal button and fill the hieght...
[themes.git] / origdiff
1 #!/bin/sh
2
3 HG_COMM_DIR=/mnt/mozilla/hg/comm-central
4 HG_MOZ_DIR=/mnt/mozilla/hg/comm-central/mozilla
5
6 RUN_DIR=$(pwd)
7 cd $(dirname "$0")
8 SCRIPT_DIR=$(pwd)
9
10 if [ -n "$1" ]; then
11   SRC_DATE="$1"
12   DST_DATE=`TZ=PST8PDT date +%Y-%m-%d`
13   COMM_DIR=suite/themes/classic/
14   MOZ_DIR=toolkit/themes/winstripe/
15   COMM_LOG=$RUN_DIR/themelog-suitedefault.$SRC_DATE.$DST_DATE.log
16   MOZ_LOG=$RUN_DIR/themelog-tkwinstripe.$SRC_DATE.$DST_DATE.log
17
18   if [ ! -e $COMM_LOG ]; then
19     echo "Getting $COMM_LOG..."
20     cd $HG_COMM_DIR
21     hg log -d ">$SRC_DATE" $COMM_DIR > $COMM_LOG
22   fi
23   if [ ! -e $MOZ_LOG ]; then
24     echo "Getting $MOZ_LOG..."
25     cd $HG_MOZ_DIR
26     hg log -d ">$SRC_DATE" $MOZ_DIR > $MOZ_LOG
27   fi
28   cd $RUN_DIR
29 else
30   echo "You must specify a start date."
31   exit 1
32 fi
33
34 for repo in "COMM" "MOZ"; do
35   HG_DIR_VAR="HG_${repo}_DIR"
36   LOG_VAR="${repo}_LOG"
37   HG_URL=`awk -F ' *= *' '/default *=/ { print $2 }' ${!HG_DIR_VAR}/.hg/hgrc`
38   REPO_NAME=`basename $HG_URL`
39   LOG_NAME=${!LOG_VAR}
40   HTML_NAME=${DIFF_NAME/.diff/.html}
41   echo "Writing $HTML_NAME..."
42   echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">' > $HTML_NAME
43   echo "<html>" >> $HTML_NAME
44   echo "  <head>" >> $HTML_NAME
45   echo "    <title>$REPO_NAME Theme Changes</title>" >> $HTML_NAME
46   echo "  </head>" >> $HTML_NAME
47   echo "  <body>" >> $HTML_NAME
48   echo "  <h1>$REPO_NAME Theme Changes</h1>" >> $HTML_NAME
49   echo "  <h2>$SRC_DATE to $DST_DATE</h2>" >> $HTML_NAME
50   echo "    <pre>" >> $HTML_NAME
51   sed -e "s/user:\(.*\)<\(.*\)>/user:\1\&lt;\2\&gt;/" \
52       -e "s|\(changeset: *[0-9]*\):\([0-9a-f]*\)|\1:<a href=\"$HG_URL/rev/\2\">\2</a>|" \
53       $LOG_NAME >> $HTML_NAME
54   echo "    </pre>" >> $HTML_NAME
55   echo "  </body>" >> $HTML_NAME
56   echo "</html>" >> $HTML_NAME
57 done
58
59 echo "done."