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 | |
---|---|---|---|---|---|
#1 | 1811 | Robert Eden | Adding new API functionality. | ||
//public/perforce/api/java/p4package/examples/StatFile.java | |||||
#2 | 1387 | David Markley |
Added the ability to reopen files, add them to changelists, and updated the documentation to reflect these changes. |
||
#1 | 1334 | David Markley |
Added more example code. Added the Counter class. Corrected the filelog methods for the FileEntry class. |
||
//guest/david_markley/p4package/examples/StatFile.java | |||||
#1 | 1332 | David Markley |
Added more example code. Added the Counter class. Corrected the filelog methods for the FileEntry class. |