SOURCES: eventum-scm-updates.patch (NEW) - match also close, close...

glen glen at pld-linux.org
Tue Mar 28 20:39:43 CEST 2006


Author: glen                         Date: Tue Mar 28 18:39:43 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- match also close, closes, closed, fix, fixed, fixes
- pass all matched issue_id-s if there multiple in commit message

---- Files affected:
SOURCES:
   eventum-scm-updates.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/eventum-scm-updates.patch
diff -u /dev/null SOURCES/eventum-scm-updates.patch:1.1
--- /dev/null	Tue Mar 28 20:39:43 2006
+++ SOURCES/eventum-scm-updates.patch	Tue Mar 28 20:39:38 2006
@@ -0,0 +1,28 @@
+--- eventum-20060324/misc/scm/process_cvs_commits.php	2006-03-28 12:21:12.000000000 +0300
++++ /home/glen/scm	2006-03-28 12:24:01.000000000 +0300
+@@ -66,19 +67,21 @@
+ $commit_msg = substr($input, strpos($input, 'Log Message:')+strlen('Log Message:')+1);
+ 
+ // parse the commit message and get the first issue number we can find
+-$pattern = "/(?:issue|bug) ?:? ?#?(\d+)/i";
+-preg_match($pattern, $commit_msg, $matches);
++$pattern = "/(?:issue|bug|close[ds]?|fix(?:e[ds])?) ?:? ?#?(\d+)/i";
++preg_match_all($pattern, $commit_msg, $matches);
+ 
+ if (count($matches) > 1) {
+     // need to encode all of the url arguments
+-    $issue_id = rawurlencode($matches[1]);
+     $commit_msg = rawurlencode($commit_msg);
+     $cvs_module = rawurlencode($cvs_module);
+     $username = rawurlencode($username);
+ 
+     // build the GET url to use
+     $ping_url = $eventum_relative_url . "scm_ping.php?module=$cvs_module&username=$username&commit_msg=$commit_msg";
+-    $ping_url .= "&issue[]=$issue_id";
++    foreach ($matches[1] as $issue_id) {
++        $ping_url .= "&issue[]=$issue_id";
++    }
++
+     for ($i = 0; $i < count($modified_files); $i++) {
+         $ping_url .= "&files[$i]=" . rawurlencode($modified_files[$i]['filename']);
+         $ping_url .= "&old_versions[$i]=" . rawurlencode($modified_files[$i]['old_revision']);
================================================================


More information about the pld-cvs-commit mailing list