I am writing a program, where i have the CL
,from which I need to access the previoius revision CL
of each file.
How can I get it ?
Code I have written till now is:
IChangelist cl = server.getChangelist(clId);
List<IFileSpec> files = cl.getFiles(true);
for(int i = 0; i < files.size() ; i++) {
IFileSpec fileSpec=files.get(i);
}
Revision specifiers can help you here (see 'p4 help revisions').
In particular, the previous revision of each of those files is the file as of the previous changelist.
So, since clId is the changelist you care about, compute change
clPrev = (clId - 1)
, and then look for 'file@clPrev'.