import java.io.*; import java.util.*; import com.perforce.api.*; public class StatFile { public static void main(String[] argv) { /* Please see the Common.java file to see how the environment is being * set up. This is important, but it is common to all the examples. */ Env env = Common.setup(); String filename = "//guest/david_markley/p4package/index.html"; Vector fileHistory = new Vector(); FileEntry fent; Debug.setDebugLevel(Debug.ERROR); try { fileHistory = FileEntry.getFileLog(env, filename); // For display/testing purposes only System.out.println("Filelog for "+filename+": \n"); Enumeration logs = fileHistory.elements(); while(logs.hasMoreElements()) { fent = (FileEntry)logs.nextElement(); fent.sync(); //Uncomment for exact time. System.out.println("\tRev: "+fent.getHeadRev()); System.out.println("\t\tChange: "+fent.getHeadChange()); System.out.println("\t\tAction: "+fent.getHeadAction()); System.out.println("\t\tType: "+fent.getHeadType()); System.out.println("\t\tOwner: "+fent.getOwner()); System.out.println("\t\tDate: "+fent.getHeadTimeString()); System.out.println("\t\tDescription: "+fent.getDescription()); } } catch (Exception ex) { ex.printStackTrace(); } Utils.cleanUp(); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 1385 | David Markley |
Added the ability to reopen files, add them to changelists, and to check-in a single file using a new changelist. |
||
#1 | 1332 | David Markley |
Added more example code. Added the Counter class. Corrected the filelog methods for the FileEntry class. |