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 | |
---|---|---|---|---|---|
#4 | 24575 | Paul Allen |
Merge pull request #78 from kroutley/p4affectedfile [JENKINS-53222] Add all FileAction enum types to P4AffectedFile |
||
#3 | 22536 | tpeths |
Modified getAction to return uppercase icon name JENKINS-45407 (tpeths) |
||
#2 | 22128 | Paul Allen |
Helix Graph support for Jenkins. JENKINS-40354 |
||
#1 | 20207 | Paul Allen |
Added implementation for getAffectedFiles() #review-20131 |