Methods Summary |
---|
public void | addFileset(org.apache.tools.ant.types.FileSet set)Adds a fileset to be examined by p4fstat.
filesets.addElement(set);
|
private void | execP4Fstat(java.lang.StringBuffer list)
String l = list.substring(0);
if (debug) {
log("Executing fstat " + P4CmdOpts + " " + addCmd + l + "\n",
Project.MSG_INFO);
}
execP4Command("fstat " + P4CmdOpts + " " + addCmd + l, handler);
|
public void | execute()Executes the p4fstat task.
handler = new FStatP4OutputHandler(this);
if (P4View != null) {
addCmd = P4View;
}
P4CmdOpts = (changelist > 0) ? ("-c " + changelist) : "";
filelist = new StringBuffer();
for (int i = 0; i < filesets.size(); i++) {
FileSet fs = (FileSet) filesets.elementAt(i);
DirectoryScanner ds = fs.getDirectoryScanner(getProject());
String[] srcFiles = ds.getIncludedFiles();
fileNum = srcFiles.length;
if (srcFiles != null) {
for (int j = 0; j < srcFiles.length; j++) {
File f = new File(ds.getBasedir(), srcFiles[j]);
filelist.append(" ").append('"").append(f.getAbsolutePath()).append('"");
doneFileNum++;
if (filelist.length() > cmdLength) {
execP4Fstat(filelist);
filelist = new StringBuffer();
}
}
if (filelist.length() > 0) {
execP4Fstat(filelist);
}
} else {
log("No files specified to query status on!", Project.MSG_WARN);
}
}
if (show == SHOW_ALL || show == SHOW_EXISTING) {
printRes(handler.getExisting(), EXISTING_HEADER);
}
if (show == SHOW_ALL || show == SHOW_NON_EXISTING) {
printRes(handler.getNonExisting(), NONEXISTING_HEADER);
}
|
public int | getLengthOfTask()Return the number of files seen.
return fileNum;
|
int | getPasses()Return the number of passes to make.
IS THIS BEING USED?
return filesets.size();
|
private void | printRes(java.util.ArrayList ar, java.lang.String header)
log(header, Project.MSG_INFO);
for (int i = 0; i < ar.size(); i++) {
log((String) ar.get(i), Project.MSG_INFO);
}
|
public void | setChangelist(int changelist)Sets optionally a change list number.
if (changelist <= 0) {
throw new BuildException("P4FStat: Changelist# should be a "
+ "positive number");
}
this.changelist = changelist;
|
public void | setShowFilter(java.lang.String filter)Sets the filter that one wants applied.
Option | Meaning |
all | all files under Perforce control or not |
existing | only files under Perforce control |
non-existing | only files not under Perforce control or not |
if (filter.equalsIgnoreCase("all")) {
show = SHOW_ALL;
} else if (filter.equalsIgnoreCase("existing")) {
show = SHOW_EXISTING;
} else if (filter.equalsIgnoreCase("non-existing")) {
show = SHOW_NON_EXISTING;
} else {
throw new BuildException("P4Fstat: ShowFilter should be one of: "
+ "all, existing, non-existing");
}
|