1

I am trying to revert files in a change list with -a and -c option. I did manually like this.

p4 revert -c 19264444 file ...
pause
p4 edit -c 19264444 GP*.*
pause
robocopy %SRC% %DEST% *.rom
pause
p4 revert -a 19264444 file ...

Trying using p4api.net

Also while opening particular files for edit at a given workspace location like this. Not sure whether format will be accepted appended in the destination path.

 //Function for Edit changelist

 public void EditChangeList(Changelist cl, string fileFormat, string   destinationPath)
    {
        var rep = Connect();
        var fs = new FileSpec(new DepotPath(destinationPath + "/" + fileFormat + "/..."));
        var ls= rep.Connection.Client.EditFiles(new Options(EditFilesCmdFlags.None, cl.Id, null), fs);
    }

 // call of above function
  p4.EditChangeList(changelist, gp*.*", destinationPath);

Also i couldn't find how to revert files in change list using p4api.net. Could some one guide on this?

Ashish Agarwal
  • 6,215
  • 12
  • 58
  • 91
test
  • 91
  • 11
  • What exactly are you asking? Whether you can use both -a and -c in the same 'p4 revert' command? How to run 'edit' from p4api.net? How to run 'revert' from p4api.net? Something else entirely? – Bryan Pendleton Jan 25 '15 at 17:21
  • @BryanPendleton. Yes correct. i want to know how i can revert files in a changelist in p4api.net – test Jan 25 '15 at 18:23
  • Also how i can open files (of particular format say gp*.*) for edit at given location in a changelist using p4api.net – test Jan 25 '15 at 18:24
  • Also i dont want to use -a and -c in one p4 revert. I want to use it independently. I want to know how i can revert files in a changelist with -a and - c parameters independently using p4api.net. Also how i can open files for edit using p4api.net – test Jan 25 '15 at 18:39
  • Here's the doc for the Client.RevertFiles method: http://www.perforce.com/perforce/doc.current/manuals/p4api.net/p4api.net_reference/html/M_Perforce_P4_Client_RevertFiles.htm – Bryan Pendleton Jan 26 '15 at 00:50
  • Yeah, i checked it but i didn't get any example. Could you provide example to revert files in a change list. – test Jan 26 '15 at 03:09
  • public IList RevertFiles( IList Files, Options options ) how i can specify change list in this function – test Jan 26 '15 at 03:11
  • To specify the -c changelist option, you'll do something like: Options opts = new Options(); opts["-c"] = _changelistToRevert.ToString(); Then those will be the options that you'll pass to Client.RevertFiles. You should set up a test server so you can try these API calls out yourself on your test platform. – Bryan Pendleton Jan 26 '15 at 14:51
  • Thanks for the reply. Yeah i did similar to what you mentioned. – test Jan 26 '15 at 17:34
  • ` var rep = Connect(); var opts = new Options(ChangeCmdFlags.None, ChangeListType.None); opts["-a"] = clNumber; // var fs = new FileSpec(new DepotPath(destinationPath + "/..." + fileFormat)); IList revertedFiles = rep.Connection.Client.RevertFiles(null, opts);` – test Jan 26 '15 at 17:37

0 Answers0