package org.jenkinsci.plugins.p4.changes; import com.perforce.p4java.core.file.FileAction; import com.perforce.p4java.core.file.IFileSpec; import hudson.scm.ChangeLogSet.AffectedFile; import hudson.scm.EditType; public class P4AffectedFile implements AffectedFile { private final String path; private final String revision; private final EditType action; public P4AffectedFile(IFileSpec item) { this.path = item.getDepotPathString(); this.revision = "#" + item.getEndRevision(); this.action = parseFileAction(item.getAction()); } public P4AffectedFile(String path, String revision, FileAction action) { this.path = path; this.revision = revision; this.action = parseFileAction(action); } @Override public String getPath() { return path; } @Override public EditType getEditType() { return action; } public String getRevision() { return revision; } public String getAction() { return action.getName().toUpperCase(); } private EditType parseFileAction(FileAction fileAction) { switch (fileAction) { case ADD: case MOVE_ADD: return EditType.ADD; case EDIT: return EditType.EDIT; case DELETE: case MOVE_DELETE: return EditType.DELETE; default: return EditType.EDIT; } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 23685 | Paul Allen | Copy main -> dev | ||
#1 | 20641 | Paul Allen | Copy main -> dev (jenkinsci/p4-plugin) | ||
//guest/perforce_software/p4jenkins/main/src/main/java/org/jenkinsci/plugins/p4/changes/P4AffectedFile.java | |||||
#1 | 20207 | Paul Allen |
Added implementation for getAffectedFiles() #review-20131 |