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