]>
src.bluestatic.org Git - bugdar.git/blob - docs/post-commit.php
2 /*=====================================================================*\
3 || ###################################################################
5 || # Copyright (c)2004-2008 Blue Static
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version 2 of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
25 * Change the two constants below to reflect your setup. Then, in your repository's
26 * /hooks/post-commit script, add the following line:
28 * /path/to/this/script/post-commit.php "$REPOS" "$REV"
31 // this is the path to the SVN binaries (namely, svnlook)
32 define('SVN_PATH', '/usr/local/bin/');
34 // path to Bugdar base install
35 define('BUGDAR_BASE', '/Server/htdocs/bugtrack/');
37 // ###################################################################
41 print("Usage: $argv[0] repository revision");
45 exec(SVN_PATH
. 'svnlook log -r' . $argv[2] . ' "' . $argv[1] . '"', $output);
46 $output = implode("\n", $output);
48 if (preg_match_all('#(fixe(s|d)|close(s|d)) bug://(report/)?([0-9]*)#i', $output, $matches) != false)
51 include 'includes/init.php';
52 include 'includes/api_bug.php';
54 foreach ($matches[5] AS $id)
57 $api->set('bugid', $id);
58 $api->set_condition();
59 $api->set('status', 4);
60 $api->set('resolution', 2);