View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004522 | mantisbt | other | public | 2004-09-10 15:53 | 2010-09-19 03:11 |
Reporter | thraxisp | Assigned To | dhx | ||
Priority | normal | Severity | feature | Reproducibility | always |
Status | closed | Resolution | won't fix | ||
Product Version | git trunk | ||||
Summary | 0004522: checkin.php should extract more information from the commit | ||||
Description | checkin.php should extract the username doing the commit from the environment (environment variable "USER"). It should also add in the file names and versions (%{sV} from the command line). | ||||
Tags | No tags attached. | ||||
Attached Files | checkin.patch (1,237 bytes)
--- mantis-0.19.2/core/checkin.php 2004-09-30 14:26:38.000000000 -0400 +++ mantis/core/checkin.php 2005-01-31 14:06:05.000000000 -0500 @@ -34,7 +34,39 @@ # Detect references to issues + concat all lines to have the comment log. $t_commit_regexp = config_get( 'source_control_regexp' ); - $t_comment = ''; + + # Special Hakcs by Gennady for Better Integration + if ($USER) { + $t_comment = "*** CVS COMMIT by $USER ***\n"; + } else + $t_comment = "*** CVS COMMIT ***\n"; + # + # Need to check the command-line stuff and build the files list. + # + + if ($argc > 1) { + $dir = strtok($argv[1], " "); + if ($dir) { + $f = strtok(" "); + + list ($file, $newrev ) = split(",", $f, 2); + #print "ARG: $i -> " . $argv[$i] . "\n"; + $v = strtok($argv[$i], ','); + #print "cvs:" . $argv[1] . "/" . $v; + $t_comment .= "cvs:" . $dir . "/" . $file; + + if ($newrev) { + #print ":$v\n"; + $t_comment .= ":$newrev\n"; + } + } + + #print "PARSED ARGS: $argc -> $t_comment\n"; + } else { + #print "NO ARGS????\n"; + } + $t_comment .= "\n"; + $t_issues = array(); while ( ( $t_line = fgets( STDIN, 1024 ) ) ) { $t_comment .= $t_line; | ||||
I have been doing this for my local mantis configuration. Some things i looked into [considering i just started figuring it out]:
Things to consider:
I am still experimenting. I could include my changes as a possible patch. I am still making some small changes. |
|
Gena01, it would be great if you can provide us with whatever work you do in this area. I implemented checkin.php on a Windows machine and hence I didn't have the infrastructure and the knowledge to do full integration. You can also evalutate the following library which integrates Mantis with several source control systems: |
|
Here is 1st draft of my checkin.php changes. It parses the %(sV} set. For a more complete integration we should support %{sVv} which would contain both the old revision and the new revision. I got it currently setup on my local setup here and it's running ok. A better way to do this is if mantis could support doing diffs while parsing and handling more than 1 revision in cvs :/ file , rev syntax. |
|
Been working on this too... and thought I had it handling diffs integrated to Horde's Chora weblog nicely... until I ran into some windows-based filenames with embedded spaces. Arrrrrrrrrrgh! Is there ANY way to pass these from loginfo notation %{sVv} as args into checkin.php and still make embedded space dirs/filenames work?! I have tried so many combinations my head is spinning. Just wondered if you have it working. |
|
When passing file names as command line parameters on Windows, it is necessary to enclose the file names in double quotes in order for them to work properly when file names include spaces. |
|
I am on unix. Just trying to handle filenames with spaces is such a pain from cvs. So far the best I have been able to do is to pass one long string in as arg1 to checkin.php... in the form of <dirname> <newrev>,<filename>,<oldrev> <newrev>,<filename>,<oldrev>...and now will have to write a char parser to make that useful. And only after passing %{vsV} so I can exploit the version#'s as "delimiters" themselves. Can't believe it has to be this hard, but to me it really looks like the fault of cvs and how they pass the filenames. What, if any, is the limitation on the length of one argument to a PHP script? That could foil my plans. jj |
|
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. |
|