View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005796 | mantisbt | administration | public | 2005-06-15 10:13 | 2010-09-19 03:11 |
Reporter | kmcnamee | Assigned To | dhx | ||
Priority | normal | Severity | feature | Reproducibility | always |
Status | closed | Resolution | won't fix | ||
Product Version | 1.0.0a3 | ||||
Summary | 0005796: CVS integration improvement | ||||
Description | I have been working on integrating Mantis with CVS, since it is the current integration is quite rudimentary. It is really useful in closed development environments such as companies Requirements: | ||||
Steps To Reproduce | 1) Set $g_source_control_account to be a valid Mantis user (e.g. "cvsuser") | ||||
Additional Information | The entry in loginfo expands into a list of files and versions followed by the usernames. See https://www.cvshome.org/docs/manual/cvs-1.11.6/cvs_18.html#SEC171 for more details. Because some of our folders and files contain spaces the extra "," avoids having to tokenise on spaces. Files that are added or removed by the commit are presented as hyperlinks to the files, whereas modified files are listed as diffs. When processing the "CVS:" tag in string_process_cvs_link, a second regexp substitution is performed to produce the diff hyperlink. This regexp matchs on cvs:filename.ext:n.nn:n.nn Also, an annoying bug was fixed where if the | ||||
Tags | No tags attached. | ||||
Attached Files | string_api.php.rc2.diff (1,788 bytes)
Index: string_api.php =================================================================== RCS file: /cvs/TPS/mantis/core/string_api.php,v retrieving revision 1.9 diff -u -r1.9 string_api.php --- string_api.php 19 Sep 2005 11:58:45 -0000 1.9 +++ string_api.php 29 Dec 2005 13:24:37 -0000 @@ -176,20 +176,33 @@ # -------------------- # process the $p_string and convert filenames in the format # cvs:filename.ext or cvs:filename.ext:n.nn to a html link + # filenames in the format cvs:filename.ext:n.nn:n.nn are + # converted to html links of diffs between the two versions # if $p_include_anchor is true, include an <a href="..."> tag, # otherwise, just insert the URL as text function string_process_cvs_link( $p_string, $p_include_anchor=true ) { $t_cvs_web = config_get( 'cvs_web' ); + if ( $p_include_anchor ) { + $t_replace_with = '[CVS] <a href="'.$t_cvs_web.'\\1?r1=\\4&r2=\\6" target="_new">\\1:\\4:\\6</a>\\7'; + } else { + $t_replace_with = '[CVS] '.$t_cvs_web.'\\1?r1=\\4&r2=\\6\\7'; + } + + $new_string = preg_replace( '/cvs:([^\.\s:,\?!]+(\.[^\.\s:,\?!]+)*)(:)(\d\.[\d\.]+)(:)(\d\.[\d\.]+)([\W\s])?/i', + $t_replace_with, + $p_string ); + + if ( $p_include_anchor ) { - $t_replace_with = '[CVS] <a href="'.$t_cvs_web.'\\1?rev=\\4" target="_new">\\1</a>\\5'; + $t_replace_with = '[CVS] <a href="'.$t_cvs_web.'\\1?rev=\\4" target="_new">\\1\\3</a>\\5'; } else { $t_replace_with = '[CVS] '.$t_cvs_web.'\\1?rev=\\4\\5'; } - return preg_replace( '/cvs:([^\.\s:,\?!<]+(\.[^\.\s:,\?!<]+)*)(:)?(\d\.[\d\.]+)?([\W\s])?/i', + return preg_replace( '/cvs:([^\.\s:,\?!]+(\.[^\.\s:,\?!<]+)*)(:(\d\.[\d\.]+))?([\W\s])?/i', $t_replace_with, - $p_string ); + $new_string ); } # -------------------- | ||||
related to | 0006092 | closed | ryandesign | CVS link gets mangled if filename is followed by a newline |
related to | 0011732 | closed | dhx | Remove built-in source code integration support |
child of | 0004181 | closed | Features in Mantis 1.1 release |
Forgot to include changes in uploaded file :) |
|
More testing done: cvs_integration3.tar.gz |
|
New version: cvs_integration.tar4.gz Please remove the old files. |
|
New version: cvs_integration5.tar.gz |
|
Merged changes with RC1 release and uploaded the diff files. |
|
I'd rather handle separate issues separately. I'll take the annoying bug that mangles the link if you have a newline after the cvs filename and fix it in 0006092. We may also want to break the other issues in this ticket out into separate tickets (if they don't exist separately already...) |
|
This is the only ticket I have created. Apart from the CVS bug everything here is really one improvement, i.e. pretty print the CVS loginfo in a bugnote. The standard loginfo text is unusable but fortunately CVS provides all the necesary information as arguments (see Step 3 in "Steps To Reproduce"). This is parsed and ordered to form a user friendly bugnote. The CVS links differ as follows: The $USER argument allows the script to try posting the bugnote with that username otherwise it defaults back to $g_source_control_account. If you need some help with this, just ask. |
|
Requirements: this does not work if you have 'anonymous' user in your setup. every note is then logged by an anonymous. |
|
see also bug 0003045. |
|
Thanks for your patches. I modified your string_api patch slightly, so that the links text still display the ":XX" and ":XX:XX" to show, it´s a link to a specific version. |
|
I just noted that in CVS >= 1.12 the old format of loginfo options is deprecated. Unfortunately, the correct loginfo line nearly not documented in the mantis documentation. There is also some confusion in which admin file to put the line: The mantis docs suggest "commitinfo" but this does not provide the version information. Just if anyone is interested, the following works with cvs 1.12 and "UseNewInfoFmtStrings=yes" in CVSROOT/config: loginfo:
in checkin.php:
|
|
can anyone upload the missing attachments? thanks |
|
Seems you cannot upload a file with the same filename again if though it says "(attachment missing)". |
|
Won't fix as this old source code integration support is being dropped in favour of using a more modern plugin approach with the SourceIntegration plugin. Refer to 0011732 for more details and feedback. |
|