-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathbranch
More file actions
executable file
·52 lines (42 loc) · 1.43 KB
/
branch
File metadata and controls
executable file
·52 lines (42 loc) · 1.43 KB
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
45
46
47
48
49
50
51
52
#! /bin/sh
if [ -z "$1" -o -n "$3" ]; then
echo "Usage: $0 branch [treeish]" >&2
exit 1
fi
branch="$1"
treeish="$2"
. `dirname $0`/split_tag.sh &&
branch="$1"
if [ -z "$treeish" ]; then
treeish="master"
fi
split_tag "`git describe --abbrev=0 \"$treeish\"`"
prev_branch="$major.$minor"
split_tag $branch
next_minor="`expr $minor + 1`"
git checkout -b "$branch" "$treeish" &&
echo "
version = '$major.$minor'
major = $major
minor = $minor
micro = 0
release_level = 'branch'
serial = 0
version_info = (major, minor, micro, release_level, serial)" > sqlobject/__version__.py &&
`git var GIT_EDITOR` README.rst sqlobject/__version__.py docs/News.rst setup.cfg setup.py docs/DeveloperGuide.rst &&
git commit --message="Branch $branch" README.rst sqlobject/__version__.py docs/News.rst setup.cfg setup.py docs/DeveloperGuide.rst &&
if [ "$treeish" = master ]; then
git checkout master && echo "
version = '$major.$next_minor'
major = $major
minor = $next_minor
micro = 0
release_level = 'trunk'
serial = 0
version_info = (major, minor, micro, release_level, serial)" > sqlobject/__version__.py &&
`git var GIT_EDITOR` README.rst sqlobject/__version__.py docs/News.rst setup.py &&
git commit --message="Next branch will be $major.$next_minor" README.rst sqlobject/__version__.py docs/News.rst setup.py &&
exec sed -i /"$major\.$minor"/"$major.$next_minor"/ ANNOUNCE.rst
else
exec sed -i /"$prev_branch"/"$major.$next_minor"/ ANNOUNCE.rst
fi