Merge lp:~tom.prince/twisted-trac-integration/report-git-rev into lp:twisted-trac-integration

Proposed by Tom Prince
Status: Merged
Approved by: Christopher Armstrong
Approved revision: 95
Merged at revision: 94
Proposed branch: lp:~tom.prince/twisted-trac-integration/report-git-rev
Merge into: lp:twisted-trac-integration
Diff against target: 35 lines (+6/-2)
1 file modified
svn-hooks/post-commit (+6/-2)
To merge this branch: bzr merge lp:~tom.prince/twisted-trac-integration/report-git-rev
Reviewer Review Type Date Requested Status
Christopher Armstrong (community) Approve
Review via email: mp+173266@code.launchpad.net

Description of the change

Report git revision corresponding to svn revision to buildbot, to support git-based builders.

To post a comment you must log in.
Revision history for this message
Christopher Armstrong (radix) wrote :

+1.

Note that we'll need someone to install the "buildbot" package on wolfwood in order for this to work.

In addition, we can remove the svn_buildbot.py script from /svn/Twisted/hooks once this is deployed.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'svn-hooks/post-commit'
2--- svn-hooks/post-commit 2013-05-27 18:22:35 +0000
3+++ svn-hooks/post-commit 2013-07-05 19:11:24 +0000
4@@ -36,10 +36,13 @@
5 REV="$2"
6 LOG=`/usr/bin/svnlook log -r $REV $REPOS`
7 AUTHOR=`/usr/bin/svnlook author -r $REV $REPOS`
8+FILES=`/usr/bin/svnlook changed -r $REV $REPOS`
9
10
11 LOCK_DIR=/var/lock/svn-hooks
12
13+GIT_MIRROR_DIRECTORY=/var/www/git/Twisted/
14+
15 if [ -e "${LOCK_DIR}" ];
16 then
17 echo "Lock dir exists."
18@@ -74,7 +77,7 @@
19
20 echo -n "GIT"
21 date
22- sudo -u gitmirror /usr/bin/env -i /var/www/git/Twisted/fetch
23+ sudo -u gitmirror /usr/bin/env -i "${GIT_MIRROR_DIRECTORY}"/fetch
24
25 echo -n "BZR"
26 date
27@@ -98,7 +101,8 @@
28
29 echo -n "BUILDBOT"
30 date
31- /svn/Twisted/hooks/svn_buildbot.py --repository "${REPOS}" --revision "${REV}" --bbserver buildbot.twistedmatrix.com --bbport 9987
32+ GIT_REVISION=$(git --git-dir "${GIT_MIRROR_DIRECTORY}" svn find-rev r"${REV}")
33+ buildbot sendchange --master buildbot.twistedmatrix.com:9987 --revision "${REV}" --who "${AUTHOR}" --comments "${LOG}" --property git_revision:"${GIT_REVISION}" ${FILES}
34
35 ) >> ~/.post-commit.log 2>&1 {SELF_REV}>$LOCK_DIR/$REV {PREV_REV}<$LOCK_DIR/$(($REV-1))
36

Subscribers

People subscribed via source and target branches

to all changes: