Re: [NAntC-Dev] Bugs in Perforce Nant Tasks

2006-09-20 Thread Gert Driesen
David,

I don't recall who originally contributed the perforce tasks (and I don't 
have the sources available right now to check).

Problem is that I don't have a perforce repository available to test 
against.

Could you review the source code of these tasks, and perhaps provide patches 
for it ?

I'll contact the orignal author and ask him to review your changes.

What do you think?

Gert

- Original Message - 
From: Weintraub, David [EMAIL PROTECTED]
To: nantcontrib-developer@lists.sourceforge.net
Sent: Tuesday, September 19, 2006 11:54 PM
Subject: [NAntC-Dev] Bugs in Perforce Nant Tasks


I am having trouble with some of the Nant Perforce tasks.

 First problem is with p4change. I am doing this:

  property name=p4Changelist value=test_test_test/
  p4change changelist=${p4Changelist}
  client=${p4Client}
  port=${p4Port}
  user=${p4User}
  verbose=${isDebug}/

 This is attempting to bring up a text file for me to edit which it
 shouldn't be doing in the middle of a nant build.

 ===
 Here's the other problem.

 I manually create a changelist, and put in my description
 test_test_test. Perforce numbers this changelist as 1001:

 Now if I do this:

   property name=p4Changelist value=test_test_test/
   p4edit
   view=${assemblyInfoFile}
   changelist=${p4Changelist}
   client=${p4Client}
   port=${p4Port}
   user=${p4User}
   verbose=${isDebug}
   failonerror=false/!--Already Checked out?--

 The file ${assemblyInfoFile} is checked out against the changelist 1001
 and not the default changelist.

 And, if I do this:

   property name=p4Changelist value=test_test_test/
   p4submit
   changelist=${p4Changelist}
   client=${p4Client}
   port=${p4Port}
   user=${p4User}
   verbose=${isDebug}/

 The submit is done against changelist 1001 and not the default
 changelist.

 However, if I do this:

   property name=p4Changelist value=test_test_test/
   p4revert
   changelist=${p4Changelist}
   client=${p4Client}
   port=${p4Port}
   user=${p4User}
   verbose=${isDebug}/

 I get the following error:

 [p4revert] Usage: revert [ -a -n -k -c changelist# ] files...
 [p4revert] Missing/wrong number of arguments.

 Even worse, If I do this:

 !-- I manually created Changelist #1001 for this Nant build --
   property name=p4Changelist value=1001/
   p4edit
   view=${assemblyInfoFile}
   changelist=${p4Changelist}
   client=${p4Client}
   port=${p4Port}
   user=${p4User}
   verbose=${isDebug}
   failonerror=false/!--Already Checked out?--

 Nant creates a new changelist with a description of 1001 instead of
 using Changelist #1001! At least this:

   property name=p4Changelist value=1001/
   p4submit
   changelist=${p4Changelist}
   client=${p4Client}
   port=${p4Port}
   user=${p4User}
   verbose=${isDebug}/

 Is using the same changelist as my original p4edit task (even its not
 the one I specified).

 However, this:

   property name=p4Changelist value=1001/
   p4revert
   changelist=${p4Changelist}
   client=${p4Client}
   port=${p4Port}
   user=${p4User}
   verbose=${isDebug}/

 Still gives me the following error:

 [p4revert] Usage: revert [ -a -n -k -c changelist# ] files...
 [p4revert] Missing/wrong number of arguments.

 I really don't mind if p4submit, p4edit, and other Perforce Nant tasks
 use the Changelist description and not the changelist number. It is also
 rather convenient that these tasks seem to create the changelist if one
 doesn't already exist with that description. However, the p4revert task
 is out of sync with the rest of the Perforce tasks, and the p4change
 task is pretty useless. Also, the p4label task doesn't work as
 documented. In the p4label task, you must have a view parameter
 while the documentation says it is optional.

 -
 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.phpp=sourceforgeCID=DEVDEV
 ___
 NAntContrib-Developer mailing list
 NAntContrib-Developer@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/nantcontrib-developer
 


-
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

Re: [NAntC-Dev] Bugs in Perforce Nant Tasks

2006-09-20 Thread Weintraub, David
I am NOT a C# developer, or even a developer. In fact, I don't even know
C#. I hadn't written a serious lick of code in over a dozen years.

However, I looked over the code, and wonder if this stuff had been
built.

The P4Changes.cs module looks like the module that the p4change task
calls. If you say

p4change delete=true
changelist=foo/

It looks like it goes to line 101 and calls the protected string
getSpecificCommandArguments(). In this member function, it appears to
be building the p4 command to execute from the command line. It adds to
the arguments the word change , then it adds a -d , then it runs
Perforce.GetChangelistNumber(User, Client, Changelist).

Perforce.GetChangelistNumber(User, Client, Changelist) is in
Perfoce.cs. It runs the p4 changes -s pending -s userID command to
get a list of changelists for that user. It then parses the output of
this command to find the string specified in changelist, and then
returns the corresponding changelist number. This changelist is added to
the change -d  argument string. So, the whole string looks like this:
change -d changelist which is the correct format of the P4 command.

Even more confusing, P4Add, P4Submit, and P4Reopen also seem to use the
same routine to find and create the changelist. I have no idea why

 p4change changelist=foo/

doesn't work as expected. I am not a C# developer, but the general
technique looks like it should be working.

I'm going to try recompiling this and see what happens.

-Original Message-
From: Gert Driesen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 20, 2006 2:56 AM
To: Weintraub, David; nantcontrib-developer@lists.sourceforge.net
Subject: Re: [NAntC-Dev] Bugs in Perforce Nant Tasks

David,

I don't recall who originally contributed the perforce tasks (and I
don't have the sources available right now to check).

Problem is that I don't have a perforce repository available to test
against.

Could you review the source code of these tasks, and perhaps provide
patches for it ?

I'll contact the orignal author and ask him to review your changes.

What do you think?

Gert

- Original Message -
From: Weintraub, David [EMAIL PROTECTED]
To: nantcontrib-developer@lists.sourceforge.net
Sent: Tuesday, September 19, 2006 11:54 PM
Subject: [NAntC-Dev] Bugs in Perforce Nant Tasks


I am having trouble with some of the Nant Perforce tasks.

 First problem is with p4change. I am doing this:

  property name=p4Changelist value=test_test_test/
  p4change changelist=${p4Changelist}
  client=${p4Client}
  port=${p4Port}
  user=${p4User}
  verbose=${isDebug}/

 This is attempting to bring up a text file for me to edit which it
 shouldn't be doing in the middle of a nant build.

 ===
 Here's the other problem.

 I manually create a changelist, and put in my description
 test_test_test. Perforce numbers this changelist as 1001:

 Now if I do this:

   property name=p4Changelist value=test_test_test/
   p4edit
   view=${assemblyInfoFile}
   changelist=${p4Changelist}
   client=${p4Client}
   port=${p4Port}
   user=${p4User}
   verbose=${isDebug}
   failonerror=false/!--Already Checked out?--

 The file ${assemblyInfoFile} is checked out against the changelist
1001
 and not the default changelist.

 And, if I do this:

   property name=p4Changelist value=test_test_test/
   p4submit
   changelist=${p4Changelist}
   client=${p4Client}
   port=${p4Port}
   user=${p4User}
   verbose=${isDebug}/

 The submit is done against changelist 1001 and not the default
 changelist.

 However, if I do this:

   property name=p4Changelist value=test_test_test/
   p4revert
   changelist=${p4Changelist}
   client=${p4Client}
   port=${p4Port}
   user=${p4User}
   verbose=${isDebug}/

 I get the following error:

 [p4revert] Usage: revert [ -a -n -k -c changelist# ] files...
 [p4revert] Missing/wrong number of arguments.

 Even worse, If I do this:

 !-- I manually created Changelist #1001 for this Nant build --
   property name=p4Changelist value=1001/
   p4edit
   view=${assemblyInfoFile}
   changelist=${p4Changelist}
   client=${p4Client}
   port=${p4Port}
   user=${p4User}
   verbose=${isDebug}
   failonerror=false/!--Already Checked out?--

 Nant creates a new changelist with a description of 1001 instead of
 using Changelist #1001! At least this:

   property name=p4Changelist value=1001/
   p4submit
   changelist=${p4Changelist}
   client=${p4Client}
   port=${p4Port}
   user=${p4User}
   verbose=${isDebug}/

 Is using the same changelist as my original p4edit task (even its not
 the one I specified).

 However, this:

   property name=p4Changelist