Jump to content


Problem submitting changelist in C# P4API.Net

submit changelist p4api.net

  • Please log in to reply
3 replies to this topic

#1 DaveCh

DaveCh

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts

Posted 23 July 2013 - 05:41 PM

I'm having trouble submitting a changelist. I have the latest P4API.Net libraries and have narrowed it down to this:

I have a changelist number N containing 1 file which is visible in P4V and has a description (in fact for this case I've just checked out an existing file). In the code, the server/repository/connection are all up and running and all other commands (adding files, synching files, etc.) are working with no problems. The problem is here:

Perforce.P4.Changelist cl = perforceRepository.GetChangelist(N);
Perforce.P4.SubmitCmdOptions options = new Perforce.P4.SubmitCmdOptions(Perforce.P4.SubmitFilesCmdFlags.None, N, null, cl.Description, null);
Perforce.P4.SubmitResults results = cl.Submit(options);

The Submit() call always throws an exception in Perforce.P4.Server.RunCommand() just containing the message
"Usage: submit [ -r -f option ] -c changelist#"

The options contain "-d" and the description and "-c" and the changelist number.

I've not seen any examples around using Changelist.Submit() so don't know what I've missed (or maybe the function has a bug?)


Dave

#2 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 23 July 2013 - 06:12 PM

With a numbered changelist you can't use the '-d' flag. The server is very tersely trying to say the only acceptable flags are -r or -f with the -c flag. I think if you drop the -d you'll be set.

#3 DaveCh

DaveCh

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts

Posted 23 July 2013 - 07:58 PM

Yes, that was it, working fine now, thanks!
I was passing in cl.Description via the options, so passing a description to a changelist that already had one - if I'd taken that out earlier it would've magically started working.
Thanks again.

#4 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 24 July 2013 - 04:00 AM

Glad I could help!





Also tagged with one or more of these keywords: submit, changelist, p4api.net

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users