]> git.droids-corp.org - git-central.git/commitdiff
Use dirname instead of an POST_RECEIVE_TRAC environment variable.
authorStephen Haberman <stephen@exigencecorp.com>
Tue, 11 Nov 2008 20:13:25 +0000 (14:13 -0600)
committerStephen Haberman <stephen@exigencecorp.com>
Tue, 11 Nov 2008 20:13:25 +0000 (14:13 -0600)
server/post-receive-trac
tests/t3000-server-post-receive-trac.sh
tests/t3001-server-post-receive-trac-with-commit-numbers.sh

index 154619708ea93d38dbcc412c645ce29ab75ba174..083837cb60da10cf2385a88678d173323191761b 100644 (file)
@@ -24,7 +24,7 @@ while read oldrev newrev refname ; do
                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
index 8c8c556b8242ed2986f13d2a597d3940d560d94d..bdb783e21d0ce80a0b51cbc612bf6eb70ae0f095 100644 (file)
@@ -5,7 +5,6 @@ test_description='server update lock check'
 . ./test-lib.sh
 
 export PYTHON=echo
-export POST_RECEIVE_TRAC=/foo/post-receive-trac.py
 export TRAC_ENV=/foo/trac
 
 test_expect_success 'setup' '
@@ -25,14 +24,14 @@ test_expect_success 'new branch' '
        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' '
@@ -41,7 +40,7 @@ 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' '
@@ -55,8 +54,8 @@ test_expect_success 'update branch to an already published commit does not doubl
 
        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' '
@@ -69,7 +68,7 @@ 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' '
@@ -84,8 +83,8 @@ 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
index 7e8abdcce905a6a92956ef46c3c820dd795ea45c..b4e5d6582b4f895a434c8b105d96360c6948a7a5 100644 (file)
@@ -5,7 +5,6 @@ test_description='server post receive trac with commit numbers'
 . ./test-lib.sh
 
 export PYTHON=echo
-export POST_RECEIVE_TRAC=/foo/post-receive-trac.py
 export TRAC_ENV=/foo/trac
 
 test_expect_success 'setup' '
@@ -25,14 +24,14 @@ test_expect_success 'new branch' '
        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' '
@@ -41,7 +40,7 @@ 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' '
@@ -55,8 +54,8 @@ test_expect_success 'update branch to an already published commit does not doubl
 
        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' '
@@ -69,7 +68,7 @@ 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' '
@@ -84,8 +83,8 @@ 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