Indefero

Indefero Commit Details


Date:2009-11-06 09:00:47 (15 years 1 month ago)
Author:Mehdi Kabab
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:73dba2fa1a573ed01c1554c8880148a6d3492b15
Parents: 3c46b7734ff20287991cbdf81f56702ec658c23c
Message:Added ticket 259, automatic linking of issues/commits to support TortoiseSVN preferred issue/commit naming.

Changes:

File differences

src/IDF/Template/IssueComment.php
4343
4444
4545
46
46
4747
4848
4949
......
7070
7171
7272
73
74
75
76
77
73
74
75
76
77
78
79
80
81
7882
79
83
84
85
86
87
88
8089
81
82
8390
84
85
86
87
91
8892
93
94
95
8996
9097
9198
......
96103
97104
98105
99
100
101
102
103
106
107
108
109
110
111
104112
113
105114
106115
107116
'<a href="\1">\1</a>', $text);
}
if ($request->rights['hasIssuesAccess']) {
$text = preg_replace_callback('#(issues?|bugs?|tickets?)\s+(\d+)(\#ic\d*){0,1}((\s+and|\s+or|,)\s+(\d+)(\#ic\d*){0,1}){0,}#im',
$text = preg_replace_callback('#((?:issue|bug|ticket)(s)?\s+|\s+\#)(\d+)(\#ic\d+)?(?(2)((?:[, \w]+(?:\s+\#)?)?\d+(?:\#ic\d+)?){0,})#im',
array($this, 'callbackIssues'), $text);
}
if ($request->rights['hasReviewAccess']) {
*/
function callbackIssues($m)
{
if (count($m) == 3 || count($m) == 4) {
$issue = new IDF_Issue($m[2]);
if ($issue->id > 0 and $issue->project == $this->project->id) {
if (count($m) == 3) {
return $this->linkIssue($issue, $m[1].' '.$m[2]);
$c = count($m);
if (4 === $c || 5 === $c) {
$issue = new IDF_Issue($m[3]);
if (0 < $issue->id and $issue->project == $this->project->id) {
$m[1] = trim($m[1]);
$prefix = '';
if ('#' === $m[1]) {
$title = $m[1].$m[3];
$prefix = mb_substr($m[0], 0, strpos($m[0], $m[1])); // fixes \n matches
} else {
return $this->linkIssue($issue, $m[1].' '.$m[2], $m[3]);
$title = $m[1].' '.$m[3];
}
if (4 === $c) {
return $prefix.$this->linkIssue($issue, $title);
} else {
return $prefix.$this->linkIssue($issue, $title, $m[4]);
}
} else {
return $m[0]; // not existing issue.
}
} else {
return preg_replace_callback('/(\d+)/',
array($this, 'callbackIssue'),
$m[0]);
return $m[0]; // not existing issue.
}
return preg_replace_callback('#(\#)?(\d+)(\#ic\d+)?#',
array($this, 'callbackIssue'),
$m[0]);
}
/**
*/
function callbackIssue($m)
{
$issue = new IDF_Issue($m[1]);
if ($issue->id > 0 and $issue->project == $this->project->id) {
return $this->linkIssue($issue, $m[1]);
} else {
return $m[0]; // not existing issue.
$issue = new IDF_Issue($m[2]);
if (0 < $issue->id and $issue->project == $this->project->id) {
if (4 === count($m)) {
return $this->linkIssue($issue, $m[1].$m[2], $m[3]);
}
return $this->linkIssue($issue, $m[1].$m[2]);
}
return $m[0]; // not existing issue.
}
/**

Archive Download the corresponding diff file

Page rendered in 0.08235s using 14 queries.