set_describe_tags "$commit"
author="$(git rev-list -n 1 $commit --pretty=format:'%cn <%ce>' | grep -v $commit)"
message="$(git rev-list -n 1 $commit --pretty=format:'%s%n%b' | grep -v $commit)"
- "$PYTHON" "$POST_RECEIVE_TRAC" "$TRAC_ENV" "$short_refname" "$describe" "$describe_tags" "$commit" "$author" "$message"
+ "$PYTHON" "$(dirname $0)/post-receive-trac.py" "$TRAC_ENV" "$short_refname" "$describe" "$describe_tags" "$commit" "$author" "$message"
# Trac will crap out if we submit ticket refs too quickly
# http://trac.edgewall.org/ticket/6466
sleep 1
. ./test-lib.sh
export PYTHON=echo
-export POST_RECEIVE_TRAC=/foo/post-receive-trac.py
export TRAC_ENV=/foo/trac
test_expect_success 'setup' '
git commit -a -m "changed on topic1" &&
new_commit_hash=$(git rev-parse HEAD) &&
git push origin topic1 2>push.err &&
- cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic1 $new_commit_hash $new_commit_hash $new_commit_hash"
+ cat push.err | grep "/foo/trac topic1 $new_commit_hash $new_commit_hash $new_commit_hash"
'
test_expect_success 'new branch with already existing does not double tap' '
git checkout -b topic2 topic1 &&
existing_commit_hash=$(git rev-parse HEAD) &&
git push origin topic2 2>push.err &&
- ! cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2"
+ ! cat push.err | grep "/foo/trac topic2"
'
test_expect_success 'update branch' '
git commit -a -m "changed on topic2" &&
new_commit_hash=$(git rev-parse HEAD) &&
git push origin topic2 2>push.err &&
- cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2 $new_commit_hash $new_commit_hash $new_commit_hash"
+ cat push.err | grep "/foo/trac topic2 $new_commit_hash $new_commit_hash $new_commit_hash"
'
test_expect_success 'update branch to an already published commit does not double tap' '
git push 2>push.err &&
- ! cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2"
- ! cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic1"
+ ! cat push.err | grep "/foo/trac topic2"
+ ! cat push.err | grep "/foo/trac topic1"
'
test_expect_success 'update branch with abbreviation' '
new_commit_describe=$(git describe HEAD) &&
new_commit_hash=$(git rev-parse HEAD) &&
git push origin topic2 2>push.err &&
- cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2 $new_commit_describe $new_commit_describe $new_commit_hash"
+ cat push.err | grep "/foo/trac topic2 $new_commit_describe $new_commit_describe $new_commit_hash"
'
test_expect_success 'update branch with abbreviation and two commits' '
second_commit_hash=$(git rev-parse HEAD) &&
git push origin topic2 2>push.err &&
- cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2 $first_commit_describe $first_commit_describe $first_commit_hash" &&
- cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2 $second_commit_describe $second_commit_describe $second_commit_hash"
+ cat push.err | grep "/foo/trac topic2 $first_commit_describe $first_commit_describe $first_commit_hash" &&
+ cat push.err | grep "/foo/trac topic2 $second_commit_describe $second_commit_describe $second_commit_hash"
'
test_done
. ./test-lib.sh
export PYTHON=echo
-export POST_RECEIVE_TRAC=/foo/post-receive-trac.py
export TRAC_ENV=/foo/trac
test_expect_success 'setup' '
git commit -a -m "changed on topic1" &&
new_commit_hash=$(git rev-parse HEAD) &&
git push origin topic1 2>push.err &&
- cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic1 $new_commit_hash r/1 $new_commit_hash"
+ cat push.err | grep "/foo/trac topic1 $new_commit_hash r/1 $new_commit_hash"
'
test_expect_success 'new branch with already existing does not double tap' '
git checkout -b topic2 topic1 &&
existing_commit_hash=$(git rev-parse HEAD) &&
git push origin topic2 2>push.err &&
- ! cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2"
+ ! cat push.err | grep "/foo/trac topic2"
'
test_expect_success 'update branch' '
git commit -a -m "changed on topic2" &&
new_commit_hash=$(git rev-parse HEAD) &&
git push origin topic2 2>push.err &&
- cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2 $new_commit_hash r/2 $new_commit_hash"
+ cat push.err | grep "/foo/trac topic2 $new_commit_hash r/2 $new_commit_hash"
'
test_expect_success 'update branch to an already published commit does not double tap' '
git push 2>push.err &&
- ! cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2"
- ! cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic1"
+ ! cat push.err | grep "/foo/trac topic2"
+ ! cat push.err | grep "/foo/trac topic1"
'
test_expect_success 'update branch with abbreviation' '
new_commit_describe=$(git describe HEAD) &&
new_commit_hash=$(git rev-parse HEAD) &&
git push origin topic2 2>push.err &&
- cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2 $new_commit_describe r/3 $new_commit_hash"
+ cat push.err | grep "/foo/trac topic2 $new_commit_describe r/3 $new_commit_hash"
'
test_expect_success 'update branch with abbreviation and two commits' '
second_commit_hash=$(git rev-parse HEAD) &&
git push origin topic2 2>push.err &&
- cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2 $first_commit_describe r/4 $first_commit_hash" &&
- cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2 $second_commit_describe r/5 $second_commit_hash"
+ cat push.err | grep "/foo/trac topic2 $first_commit_describe r/4 $first_commit_hash" &&
+ cat push.err | grep "/foo/trac topic2 $second_commit_describe r/5 $second_commit_hash"
'
test_done