3
# Copyright (c) 2009 Fabien Tassin <fta@sofaraway.org>
5
# This program is free software; you can redistribute it and/or
6
# modify it under the terms of the GNU General Public License as
7
# published by the Free Software Foundation; either version 2, or (at
8
# your option) any later version.
10
# This program is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
# General Public License for more details.
15
# You should have received a copy of the GNU General Public License along
16
# with this program; if not, write to the Free Software Foundation, Inc.,
17
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25
echo "Usage: $0 MOZ_URL [BRANCH]"
27
echo "Ex: $0 http://hg.mozilla.org/releases/mozilla-1.9.2 default"
31
if [ Z$BRANCH = Z ] ; then
35
# Get the tip of $BRANCH
36
URL_BASE=`echo $URL | sed -e 's,^\(http://[^/]*\)/.*,\1,'`
37
TIP=`wget -qO- $URL/summary | sed -e '1,/>branches</d' | grep ">$BRANCH<" | \
38
sed -e 's,.*<td>'$BRANCH'</td><td class="link"><a href="\([^"]*\)">changeset</a>.*,\1,'`
40
# Get the rev-id and hash of this top
41
REVS=`wget -qO- $URL_BASE$TIP | grep '^<title>' | sed -e 's/.* changeset \([^<]*\).*/\1/'`
42
REV=`echo $REVS | cut -d: -f1`
43
HASH=`echo $REVS | cut -d: -f2`
45
# Get the date of this tip
46
DATE=`wget -qO- "$URL/pushlog?changeset=$HASH" | grep '^ <updated>' | tr '<>' '"' | cut -d'"' -f3 | cut -dT -f1 | tr -d '-'`