Trying to revert files in a changelist using -a option in p4api.net method. It used to work for me but now am getting exception with below message.
Also p4 edit and p4 revert with -c option works fine but p4 revert with -a option throws below exception. I don't know why its picking below test project location in p4 workspace location.
Exception:
Path 'd:\cftt\Dev\source\BRF\BRF.Business.Test\bin\Debug\19402547' is not under client's root 'D:\p4'.
// to open files for edit in a given changelist at certain loc with particular file format
public IList<FileSpec> EditChangeList(string clNumber, string fileFormat, string destinationPath)
{
try
{
var rep = Connect();
var opts = new Options(ChangeCmdFlags.None, ChangeListType.None);
opts["-c"] = clNumber;
var fs = new FileSpec(new DepotPath(destinationPath + "/..." + fileFormat));
IList<FileSpec> editedFileSpec = rep.Connection.Client.EditFiles(new List<FileSpec> {fs}, opts);
return editedFileSpec;
}
catch (Exception exc)
{
Logger.LogError(exc.Message);
throw;
}
}
// to revert files in a changelist that are unchanged using -a option
public IList<FileSpec> RevertChangeList(string clNumber, string destinationPath)
{
try
{
var rep = Connect();
var opts = new Options(ChangeCmdFlags.None, ChangeListType.None);
opts["-a"] = clNumber;
var fs = new FileSpec(new DepotPath(destinationPath + "/..."));
IList<FileSpec> revertedFiles = rep.Connection.Client.RevertFiles(new List<FileSpec> {fs}, opts);
return revertedFiles;
}
catch (Exception exc)
{
Logger.LogError(exc.Message);
throw;
}
}