#!/bin/sh # # Some initialization # WANT_HTML=1 BRANCH_VERSION="v1.5" TRAC_URL="https://svn.open-mpi.org/trac/ompi" TRUNK_URL="https://svn.open-mpi.org/svn/ompi/trunk/" RELATIVE_URL="https://svn.open-mpi.org/svn/ompi/branches/$BRANCH_VERSION" # XXX might be really tmp by spec $$ TMP_REVS="$TMPDIR/ompi_revs.txt" REVS_NOTES="ompi_branch_check_revisions-$BRANCH_VERSION.txt" MERGE_LOG="$TMPDIR/ompi_merge_log.txt" MERGE_FILE="$TMPDIR/ompi_merge.txt" MSG_WIDTH=90 PARSE_REVS=0 function usage() { echo "Outputs a HTML or a comma-separated file, listing outstanding r-numbers." echo "May use an input file per branch, describing notes such as pending CMRs," echo "dependencies or reasons, why a revision should not be moved." echo "" echo "Usage: $0 [-h] [-b Branch] [-u URL] [-o Output Type]" echo "" echo "-h This help" echo "-b Branch version, which is appended to default URL [default:v1.5]" echo "-u URL to compare to [default: https://svn..../ompi/branches/BRANCH_VERSION]" echo "-o Output Type, possible: txt, html [default:html]" echo "-w Width of commit msg. that will be cut at [default:90]" echo "-m Merge file [default: extract from svn log of BRANCH_VERSION]" echo "-r Revision file with notes [default:svn update of `basename $0 .sh`-BRANCH_VERSION.txt]" echo "-p Parse revision file notes (see notes below) [default:off]" echo "" echo "When parsing the revision file notes (see option -r), the following marks will be done" echo " MAILED Author has been made aware of filing a CMR" echo " CMR:BRANCH[:NUM] There exists a CMR (with link to TRACS)" echo " MERGED The Revision will not show up in the output" echo "The markings are in increasing order, i.e. if MERGED is part of notes the line is not shown." exit 1 } function check_svn_url() { URL=$1 svn list $URL > /dev/null 2>&1 if test $? != 0 ; then echo "ERROR: The provided URL:$URL is not correct or cannot svn list" exit 1 fi } # # Check the options # while getopts "b:o:u:w:m:r:ph" opt; do case $opt in b) BRANCH_VERSION=$OPTARG RELATIVE_URL="https://svn.open-mpi.org/svn/ompi/branches/$BRANCH_VERSION" ;; o) if test "$OPTARG" = "html" ; then WANT_HTML=1 elif test "$OPTARG" = "txt" ; then WANT_HTML=0 else usage fi ;; u) RELATIVE_URL=$OPTARG ;; w) MSG_WIDTH=$OPTARG ;; m) MERGE_FILE=$OPTARG ;; r) REVS_NOTES=$OPTARG ;; p) PARSE_REVS=1 ;; h) usage ;; :) echo "Option -$OPTARG requires an argument." usage ;; \?) echo "Invalid option: -$OPTARG" usage ;; esac done # Check the URLs check_svn_url $TRUNK_URL check_svn_url $RELATIVE_URL svn mergeinfo --show-revs eligible $TRUNK_URL $RELATIVE_URL > $TMP_REVS if test \! -f $TMP_REVS ; then echo "ERROR: TMP_REVS:$TMP_REVS file is not available" exit 1 fi svn update $TRUNK_URL/contrib/$REVS_NOTES > /dev/null 2>&1 # If there is no notes file (nothing checked out, nothing local) reset NOTES if test \! -f $REVS_NOTES ; then unset REVS_NOTES NOTES="" fi # The ALREADY merged (but by means of "svn mergeinfo" not recognised) # revisions can be "savely" parsed: if test $PARSE_REVS = 1 ; then svn log --incremental --stop-on-copy $RELATIVE_URL > $MERGE_LOG grep '^From r' $MERGE_LOG | sed -e 's/From \(r[0-9]*\):/\1/' > $MERGE_FILE fi DATE=`date +%Y.%m.%d` if test "x$WANT_HTML" = "x1" ; then echo "
Revision | Author | Commit Msg. | Notes |
---|---|---|---|
$REV | $AUTHOR | $MSG | $NOTES |