There is a bug in
the changelist parameter for all the Perforce nant tasks that take the
changelist parameter.
If the
changelist parameter's value is longer than 31 characters, each task will create
a new changelist even though you are using the same changelist parameter value
with each one.
The bug is in
"GetChangelistNumber(string User, string Client, string ChangeList)" function
(line #76) in Perforce.cs. If this function cannot match the changelist
description given in the changelist parameter in the various P4 nant tasks, the
various Perforce nant tasks will create a new changelist.
The bug has to do
with the way that the "p4 changes -u <userID> -s pending" command produces
output. This command only lists the first 31 characters of the changelist
description, so long changelists will never match the changelist parameter
value passed to this function.
There are several possible
solutions:
* Fail the CreateChangeList function if the
ChangeList parameter passed is longer than 31 characters. This will have to be
documented.
* Have GetChangelistNumber and
CreateChangeList functions truncate the ChangeList parameter to 31 characters.
This will guarantee a match if the changelist already exists. The question is
whether you're better off truncating the front, end, or middle of this
parameter, and I guess revolves around whether in a long description whether the
beginning or end will most likely be unique. I had a Pascal compiler that
truncated extra long variable names in the middle on the assumption that in very
long names, the first characters and last characters are likely to be unique,
and the middle characters are likely to be duplicates.
* Use either "p4 -ztag changes -u
<userID> -s pending" or "p4 changes -u <userID> -s pending -L" for
matching the description to the changelist number in GetChangelistNumber
function. These two commands won't truncate the description of the changelist,
but you'll have to change the logic of this function since both of these
commands list the changelist description on a separate line from the changelist
number.
* Rewrite all of the Perforce tasks to use
Perforce's P4COM interface that directly calls the P4API instead of depending
upon the command line command outputs. We can include the P4COM as part of the
distribution. There is a version for both Windows and Linux, but it isn't open
source. That might affect the GNU
license.
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ NAntContrib-Developer mailing list NAntContrib-Developer@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nantcontrib-developer