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, String action) { this.path = path; this.revision = revision; this.action = parseCommitAction(action); } @Override public String getPath() { return path; } @Override public EditType getEditType() { return action; } public String getRevision() { return revision; } public String getAction() { return action.getName(); } 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; } } private EditType parseCommitAction(String action) { for(EditType type : EditType.ALL) { if(type.getName().equalsIgnoreCase(action)) { return type; } } return EditType.EDIT; } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 22000 | Paul Allen |
Use graph p4 describe to fetch committed files. Update P4Ds |
||
#2 | 21990 | Paul Allen |
Reporting Graph changes. Update Browser and Jelly code to use String and not URL for url in Data Binding to Jelly. Use P4AffectedFile object for XML storage and not IFileSpec to allow Graph use. |
||
#1 | 21940 | Paul Allen | Branching using p4-jenkins | ||
//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 |