public SCMRevisionState get(@Nonnull SCM scm) { return revisionStates.get(scm.getKey()); }
public void add(@Nonnull SCM scm, @Nonnull SCMRevisionState scmState) { String key = scm.getKey(); SCMRevisionState old = revisionStates.put(key, scmState); if (old != null) { Logger.getLogger(MultiSCMRevisionState.class.getName()).log(Level.FINE, "overriding old revision state {0} from {1}", new Object[] {old, key}); } }
@Override public void onCheckout(Run<?,?> build, SCM scm, FilePath workspace, TaskListener listener, File changelogFile, SCMRevisionState pollingBaseline) throws Exception { if (build instanceof WorkflowRun && pollingBaseline != null) { WorkflowJob job = ((WorkflowRun) build).getParent(); if (job.pollingBaselines == null) { job.pollingBaselines = new ConcurrentHashMap<>(); } job.pollingBaselines.put(scm.getKey(), pollingBaseline); } } }
public SCMRevisionState get(@NonNull SCM scm, FilePath ws, @Nullable AbstractBuild<?,?> build) { SCMRevisionState state = revisionStates.get(scm.getKey()); // At the moment we have a SCM that doesn't require a workspace ws will be null if (state == null && ws != null) { // backward compatibility with 0.2 state = revisionStates.get(keyFor(scm, ws, build)); } // for backward compatibility with version 0.1, try to get the state using the class name as well if (state == null) state = revisionStates.get(scm.getClass().getName()); return state; }
@Override public Collection<? extends SCM> getSCMs() { WorkflowRun b = getLastSuccessfulBuild(); if (b == null) { b = getLastCompletedBuild(); } if (b == null) { return Collections.emptySet(); } Map<String,SCM> scms = new LinkedHashMap<>(); for (WorkflowRun.SCMCheckout co : b.checkouts(null)) { scms.put(co.scm.getKey(), co.scm); } return scms.values(); }
public MultiSCMChangeLogParser(List<SCM> scms) { scmLogParsers = new HashMap<String, ChangeLogParser>(); scmDisplayNames = new HashMap<String, String>(); scmRepositoryBrowsers = new HashMap<String, RepositoryBrowser<?>>(); for(SCM scm : scms) { String key = scm.getKey(); if(!scmLogParsers.containsKey(key)) { scmLogParsers.put(key, scm.createChangeLogParser()); String displayName = scm.getDescriptor().getDisplayName(); if (key != displayName) { displayName = String.format("%s (%s)", displayName, key); } scmDisplayNames.put(key, displayName); scmRepositoryBrowsers.put(key, scm.getBrowser()); } } }
public void add(@NonNull SCM scm, @NonNull FilePath ws, @Nullable Run<?,?> build, SCMRevisionState scmState) { revisionStates.put(scm.getKey(), scmState); }
scm.getKey(), StringEscapeUtils.escapeXml(subLogText), MultiSCMChangeLogParser.SUB_LOG_TAG));
continue; String key = co.scm.getKey(); SCMRevisionState pollingBaseline = pollingBaselines.get(key); if (pollingBaseline == null) {
if (fs != null) { String script = fs.child(expandedScriptPath).contentAsString(); listener.getLogger().println("Obtained " + expandedScriptPath + " from " + scm.getKey()); Queue.Executable exec = owner.getExecutable(); FlowDurabilityHint hint = (exec instanceof Item) ? DurabilityHintProvider.suggestedFor((Item)exec) : GlobalDefaultFlowDurabilityLevel.getDefaultDurabilityHint(); dir = new FilePath(owner.getRootDir()); listener.getLogger().println("Checking out " + scm.getKey() + " into " + dir + " to read " + expandedScriptPath); String script = null; Computer computer = node.toComputer();
try { String text = fs.child(step.path).contentAsString(); listener.getLogger().println("Obtained " + step.path + " from " + standaloneSCM.getKey()); return text; } catch (IOException | InterruptedException x) {
try { String text = fs.child(step.path).contentAsString(); listener.getLogger().println("Obtained " + step.path + " from " + standaloneSCM.getKey()); return text; } catch (IOException | InterruptedException x) {