project = sys.argv[1]
refname = sys.argv[2]
-rev = sys.argv[3]
+describe = sys.argv[3]
+rev = sys.argv[4]
def refs(ticket):
pass
username = authorPattern.findall(changeset.author)[0]
now = datetime.now(utc)
- message = "(On %s [%s]) %s" % (refname, rev, changeset.message)
+ message = "(On %s [../changeset/%s %s]) %s" % (refname, rev, describe, changeset.message)
ticket['branch'] = refname
ticket.save_changes(username, message, now, db, cnum+1)
db.commit()
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"
+ cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic1 $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 $existing_commit_hash"
+ ! cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2 $existing_commit_hash $existing_commit_hash"
'
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"
+ cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2 $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 $topic2_hash"
- ! cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic1 $topic1_hash"
+ ! cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2 $topic2_hash $topic2_hash"
+ ! cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic1 $topic1_hash $topic1_hash"
+'
+
+test_expect_success 'update branch with abbreviation' '
+ git checkout topic2
+ git tag -m "release1" release1 &&
+ git push --tags &&
+
+ echo "$test_name" >a &&
+ git commit -a -m "changed on topic2" &&
+ 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_hash"
'
test_done