summaryrefslogtreecommitdiff
path: root/test/review
blob: e1ccb9c0aff8126e132c26209aceffda8f6abf35 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh

if [ -z $1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ] || [ "$1" = "-?" ]; then
  echo "Usage: `basename $0` [rev] [args]\n"
  echo "  [rev]  : either the revision number without leading 'r' (post-commit),"
  echo "           or '-loc' to create a review from current local changes (pre-commit)\n"
  echo "  [args] : optional arguments:"
  echo "     -r ID     existing review request ID to update\n"
  exit 1
fi

POSTREVIEW=`dirname $0`/postreview.py

if [ "$1" = "-loc" ]; then
  echo "creating review request from local changes..."
  REVARG=""
  LOG=""
  SUMMARY="local changes"
  REPO=""
else
  REV=$1
  PREV=`expr $REV - 1`
  if [ $? -ne 0 ]; then
    echo "argument revision not a number: $REV"
    exit 1
  fi

  echo "creating review request for changeset $REV..."

  LOG="`svn log http://lampsvn.epfl.ch/svn-repos/scala -c $REV`"
  if [ $? -ne 0 ]; then
    echo "could not get svn log for revision $REV"
    exit 1
  fi

  REVARG="--revision-range=$PREV:$REV"
  SUMMARY="r$REV"
  REPO="--repository-url=http://lampsvn.epfl.ch/svn-repos/scala"
fi


shift # remove parameter $1 (revision)

python $POSTREVIEW --server="https://chara2.epfl.ch" $REVARG --summary="$SUMMARY" --description="$LOG" $REPO -o $@