1*4fee23f9Smrg#! /bin/bash 2*4fee23f9Smrg 3*4fee23f9Smrg# Make a list of revisions for commits to the branch of interest (trunk 4*4fee23f9Smrg# by default) between the specified dates. This skips commits that do 5*4fee23f9Smrg# not modify any existing files and changes by gccadmin. 6*4fee23f9Smrg# 7*4fee23f9Smrg# Copyright (C) 2007 Free Software Foundation. 8*4fee23f9Smrg# 9*4fee23f9Smrg# This file is free software; you can redistribute it and/or modify 10*4fee23f9Smrg# it under the terms of the GNU General Public License as published by 11*4fee23f9Smrg# the Free Software Foundation; either version 3 of the License, or 12*4fee23f9Smrg# (at your option) any later version. 13*4fee23f9Smrg# 14*4fee23f9Smrg# This program is distributed in the hope that it will be useful, 15*4fee23f9Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 16*4fee23f9Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17*4fee23f9Smrg# GNU General Public License for more details. 18*4fee23f9Smrg# 19*4fee23f9Smrg# For a copy of the GNU General Public License, write the the 20*4fee23f9Smrg# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21*4fee23f9Smrg# Boston, MA 02111-1301, USA. 22*4fee23f9Smrg 23*4fee23f9Smrg#set -ex 24*4fee23f9Smrg 25*4fee23f9Smrgabort() { 26*4fee23f9Smrg echo "$@" 27*4fee23f9Smrg exit 1 28*4fee23f9Smrg} 29*4fee23f9Smrg 30*4fee23f9Smrgtest $# -lt 2 && abort "usage: $0 low_date high_date [branch]" 31*4fee23f9Smrg 32*4fee23f9Smrgexport TZ=UTC 33*4fee23f9SmrgLOW_DATE="$1" 34*4fee23f9SmrgHIGH_DATE="$2" 35*4fee23f9Smrg 36*4fee23f9Smrgif [ $# -eq 3 ]; then 37*4fee23f9Smrg BRANCH="$3" 38*4fee23f9Smrgelse 39*4fee23f9Smrg BRANCH="" 40*4fee23f9Smrgfi 41*4fee23f9Smrg 42*4fee23f9Smrg# Verify branch name, convert a short name to the real one. 43*4fee23f9Smrg 44*4fee23f9Smrgcase $BRANCH in 45*4fee23f9Smrg"") BRANCH="trunk";; 46*4fee23f9Smrgmline) BRANCH="trunk";; 47*4fee23f9Smrgmainline) BRANCH="trunk";; 48*4fee23f9Smrg4.1) BRANCH="gcc-4_1-branch";; 49*4fee23f9Smrggcc-4_1-branch) ;; 50*4fee23f9Smrg4.0) BRANCH="gcc-4_0-branch";; 51*4fee23f9Smrggcc-4_0-branch) ;; 52*4fee23f9Smrg3.4) BRANCH="gcc-3_4-branch";; 53*4fee23f9Smrggcc-3_4-branch) ;; 54*4fee23f9Smrg*) ;; # abort "$0: unrecognized branch $BRANCH" 55*4fee23f9Smrgesac 56*4fee23f9Smrg 57*4fee23f9Smrgif [ "${BRANCH}" = "trunk" ]; then 58*4fee23f9Smrg BRANCHPATH=trunk 59*4fee23f9Smrgelse 60*4fee23f9Smrg BRANCHPATH=branches/${BRANCH} 61*4fee23f9Smrgfi 62*4fee23f9Smrg 63*4fee23f9Smrg# Get the revision at the time of LOW_DATE. 64*4fee23f9Smrg 65*4fee23f9SmrgLOW_REV=`svn info --revision {"${LOW_DATE}"} \ 66*4fee23f9Smrg ${REG_SVN_REPO}/${BRANCHPATH} \ 67*4fee23f9Smrg | awk '/Revision:/ { print $2 }'` 68*4fee23f9Smrg 69*4fee23f9Smrg# Create the list of information for LOW_REV through HIGH_DATE in a 70*4fee23f9Smrg# form expected by gcc-svn-ids. 71*4fee23f9Smrg 72*4fee23f9Smrgsvn log --quiet --non-interactive \ 73*4fee23f9Smrg --revision ${LOW_REV}:{"${HIGH_DATE}"} \ 74*4fee23f9Smrg ${REG_SVN_REPO}/${BRANCHPATH} \ 75*4fee23f9Smrg | awk -v branch=$BRANCH \ 76*4fee23f9Smrg 'BEGIN { id=0 } 77*4fee23f9Smrg /---/ { next } 78*4fee23f9Smrg /(no author)/ { next } 79*4fee23f9Smrg /gccadmin/ { next } 80*4fee23f9Smrg { sub(" \\+0000 (.*)","") 81*4fee23f9Smrg sub("r","",$1) 82*4fee23f9Smrg gsub(" \\| ","|") 83*4fee23f9Smrg id++ 84*4fee23f9Smrg print id "|" $0 "|" branch 85*4fee23f9Smrg }' 86