Fix #338: re.sub() flag argument at wrong position.
[docutils.git] / sandbox / infrastructure / attic / dbackport.sh
blob69138c8a7ad1a143edeeaee2cf4ad190b9f6bf0e
1 #!/bin/bash
3 # Author: Lea Wiemann
4 # Contact: LeWiemann@gmail.com
5 # Revision: $Revision$
6 # Date: $Date$
7 # Copyright: This script has been placed in the public domain.
9 set -e
11 if test -z "$1" -o "$1" == "-h" -o "$1" == "--help"; then
12 echo Usage: "`basename "$0"` [-c] <revision> [[-c] <revision> ...]"
13 echo
14 echo 'Any revision number that is prepended with "-c" is only checked in;'
15 echo 'no actual merging is done. (Useful for resuming aborted backports,'
16 echo 'for example after manually resolving conflicts.)'
17 exit 1
20 while test -n "$1"; do
21 commit_only=
22 if test "$1" == "-c"; then
23 commit_only=1
24 if test -z "$2"; then
25 echo 'Error: Expected revision number after "-c".'
26 exit 1
28 shift
30 r="$1"
31 if test ! "$DOCUTILS_MAINT_BRANCH"; then
32 echo '$DOCUTILS_MAINT_BRANCH must point to the directory of the'
33 echo 'maintenance branch.'
34 exit 1
37 cd "$DOCUTILS_MAINT_BRANCH"
38 if test -z "$commit_only"; then
39 svn revert . -R
40 svn up
41 svn merge -r"$[$r-1]:$r" ../../trunk/docutils .
43 svn diff
44 if test "`svn st docutils test *.py -q`"; then
45 # Some code has changed.
46 # Python 2.5 is faster and outputs unified diffs for the functional
47 # tests, so it comes first.
48 nice python2.5 -u test/alltests.py
49 nice python2.1 -u test/alltests.py
50 nice python2.2 -u test/alltests.py
51 nice python2.3 -u test/alltests.py
52 nice python2.4 -u test/alltests.py
54 echo
55 echo Press enter to commit or Ctrl+C to abort.
56 read
57 svn ci -m "--- MERGE: merged r$r to maintenance branch; original log message:
58 `svn pg svn:log --revprop -r "$r"`"
59 shift
60 done