Jump to content


alternative of p4 submit command

depot submit p4 alternative

  • Please log in to reply
4 replies to this topic

#1 dghere

dghere

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 08 January 2014 - 09:27 AM

I am using p4api.net.

What is the p4api.net equivalent of the following command line :
p4 submit


What I am getting in sample codes is a method called SubmitFiles() ... with options to be provided.
I do not want to provide any options. Just want a simple submit as we can do from the command line.

Thanks in advance.

#2 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 08 January 2014 - 06:44 PM

That's the only method we have to submit files unfortunately. If you're submitting files from the default changelist there aren't many options that you need to set, but will need to create a SubmitCmdOptions object to set the description. I can add you to the request for a simpler submit option if you'd like.

#3 dghere

dghere

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 09 January 2014 - 05:05 AM

Please let me know how to submit files from the default changelist using SubmitFiles method.

Thanks and regards.

#4 dghere

dghere

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 09 January 2014 - 12:08 PM

Thanks for your help. I have managed to achieve what I wanted. My code is as below
private void button6_Click(object sender, EventArgs e)  //Integrate file
		{
			string clDescription = "submit testfile_7.txt";
			string old_name = "//DevelopmentTools/relzilla/testfile_7.txt";
			string new_name = "//DevelopmentTools/relzilla/aod/testfile_7.txt";
			IntegrateFilesCmdOptions options = new IntegrateFilesCmdOptions(IntegrateFilesCmdFlags.None, -1, 0, null, null, null);
			Perforce.P4.SubmitCmdOptions optSubmit = new Perforce.P4.SubmitCmdOptions(Perforce.P4.SubmitFilesCmdFlags.None, -1, null, clDescription, null);
			//Perforce.P4.Changelist cl =  Perforce.P4.get;
			//Perforce.P4.Options optSubmit = new Perforce.P4.Options();
			try
			{
				var from = new FileSpec(new ClientPath(old_name), VersionSpec.Head);
				var to = new FileSpec(new ClientPath(new_name), VersionSpec.None);
				mPerforceConnection.Client.IntegrateFiles(from, options, to);
				mPerforceConnection.Client.SubmitFiles(optSubmit,null);
				MessageBox.Show("File integrated and submitted!", "Integrate and submit file", MessageBoxButtons.OK, MessageBoxIcon.Information);
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message, "integrate and submit file", MessageBoxButtons.OK, MessageBoxIcon.Error);
			}
		}


#5 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 09 January 2014 - 05:52 PM

I'm glad you got that up running! Let me know if you run into other roadblocks.





Also tagged with one or more of these keywords: depot, submit, p4, alternative

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users