]> scripts.mit.edu Git - wizard.git/blob - bin/prepare-retro-upgrade
Set admin e-mail address properly on MediaWiki >= 1.18.0
[wizard.git] / bin / prepare-retro-upgrade
1 #!/bin/bash
2 set -xe
3
4 APP="$1"
5 VERSION="$2"
6 PRIOR="$3"
7 APPLICATION="$4"
8
9 if [ -z "$APPLICATION" ]; then
10     echo "$0 APP VERSION PRIOR-VERSION APPLICATION"
11     echo
12     echo "Prepares a retroactive upgrade on a repository.  Be"
13     echo "sure to run tests/prepare-upgrade.sh on the resulting"
14     echo "commits on a scripts server."
15     echo
16     echo "      APP : short name, like 'wordpress'"
17     echo "      VERSION : version being retro'd"
18     echo "      PRIOR-VERSION : version to retro on to"
19     echo "      APPLICATION : full name of application for commit message"
20     echo
21     echo "See docs/upgrade.rst <http://scripts.mit.edu/wizard/upgrade.html>"
22     echo "for detailed instructions."
23     exit 1
24 fi
25
26 git checkout -b tmaster || git checkout tmaster
27 git reset --hard $APP-$PRIOR-scripts
28 git checkout -b tpristine || git checkout tpristine
29 git reset --hard $APP-$PRIOR
30
31 DATE=`git show tmaster --pretty="format:%cd" | head -n1`
32
33 export GIT_AUTHOR_DATE="$DATE"
34 export GIT_COMMITTER_DATE="$DATE"
35
36 wizard prepare-pristine $APP-$VERSION --force
37 git commit -asm "$APPLICATION $VERSION"
38 git tag $APP-$VERSION
39
40 git checkout tmaster
41 git merge tpristine --no-commit || (echo "Dropping into shell; exit when complete." && bash) || true
42 git commit -asm "$APPLICATION $VERSION-scripts"
43 git tag $APP-$VERSION-scripts