package org.jenkinsci.plugins.p4.scm; import edu.umd.cs.findbugs.annotations.NonNull; import hudson.init.InitMilestone; import hudson.init.Initializer; import hudson.model.Items; import jenkins.scm.api.SCMFile; import jenkins.scm.api.SCMProbe; import jenkins.scm.api.SCMProbeStat; import org.jenkinsci.plugins.p4.client.ConnectionHelper; import java.io.IOException; import java.util.logging.Logger; public class P4SCMProbe extends SCMProbe { @Initializer(before = InitMilestone.PLUGINS_STARTED) public static void addAliases() { Items.XSTREAM2.addCompatibilityAlias("org.jenkinsci.plugins.p4.scm.P4Probe", P4SCMProbe.class); } private static final long serialVersionUID = 1L; private static Logger logger = Logger.getLogger(P4SCMProbe.class.getName()); private final P4SCMHead head; private transient ConnectionHelper p4; public P4SCMProbe(ConnectionHelper p4, P4SCMHead head) { this.head = head; this.p4 = p4; } @Override public String name() { return head.getName(); } @Override public long lastModified() { long last = 0L; try { P4Path path = head.getPath(); // TODO this may need to scan 'mappings' for HelixBranches long change = p4.getHead(path.getPathBuilder("...")); if (change > last) { last = change; } } catch (Exception e) { logger.warning("Unable to check changes: " + e.getMessage()); } return last; } @Override public SCMProbeStat stat(@NonNull String file) throws IOException { try { P4Path path = head.getPath(); String depotPath = path.getPathBuilder(file); if (p4.hasFile(depotPath)) { return SCMProbeStat.fromType(SCMFile.Type.REGULAR_FILE); } } catch (Exception e) { throw new IOException("Unable to check file: " + e.getMessage()); } return SCMProbeStat.fromType(SCMFile.Type.NONEXISTENT); } @Override public void close() throws IOException { // No need to close ConnectionHelper } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#7 | 28463 | Paul Allen |
FindBugs error: SE_TRANSIENT_FIELD_NOT_RESTORED (transient but isn't set by deserialisation) |
||
#6 | 26673 | Paul Allen |
Code cleanup - remove calls to Deprecated methods - Deprecated classes like AbstractStepImpl, AbstractStepDescriptorImpl and AbstractSynchronousStepExecution for P4TaggingStep |
||
#5 | 26603 | Paul Allen |
Merge pull request #119 from joel-f-brown/master Add virtual stream detection for MultiBranch pipeline. JENKINS-62699 |
||
#4 | 26585 | Paul Allen |
Use a TempClientHelper to map the P4Path and then check for changes. JENKINS-62259 |
||
#3 | 25014 | Paul Allen |
Scan per change support for MultiBranch with remote Jenkinsfiles. Only the 'Polling per Change' Filter is supported; need to disable or support the other filter types. JENKINS-53936 |
||
#2 | 24671 | Paul Allen |
Added backwards support for old XML data. Class rename in 1.9.0 would prevent processing of old build data. JENKINS-53870 |
||
#1 | 24501 | Paul Allen | Refactor to use P4SCMXxx naming convention. | ||
//guest/perforce_software/p4jenkins/main/src/main/java/org/jenkinsci/plugins/p4/scm/P4Probe.java | |||||
#10 | 24500 | Paul Allen | Tidyup and refactor P4Ref classes. | ||
#9 | 24487 | Paul Allen | Perforce Connection Refactor. | ||
#8 | 24454 | Paul Allen |
Exclude and Include mapping support. Refactored P4Path usage and added P4SwarmPath. JENKINS-49804 |
||
#7 | 23327 | Paul Allen | Use client less connection when scanning MultiBranch. | ||
#6 | 22875 | Paul Allen | Refactor P4Path and Swarm API | ||
#5 | 22678 | Paul Allen |
MultiBranch support for Helix4Git (GitHub PR model). Update MultiBranch product names to Helix. |
||
#4 | 22396 | Paul Allen |
MultiBranch support for Perforce Swarm Reviews. A work in progress - adds Swarm API support to find branches and reviews from a Swarm project. #review-22354 |
||
#3 | 22128 | Paul Allen |
Helix Graph support for Jenkins. JENKINS-40354 |
||
#2 | 21794 | Paul Allen |
Merge pull request #39 from Dohbedoh/JENKINS-34825 Jenkins 34825 |
||
#1 | 21758 | Paul Allen |
Merge pull request #38 from jenkinsci/dev scm-api 2.0.2 updates |