@Override public void checkout(Run<?,?> build, Launcher launcher, FilePath workspace, TaskListener listener, File changelogFile, SCMRevisionState baseline) throws IOException, InterruptedException { if (changelogFile != null) { createEmptyChangeLog(changelogFile, listener, "log"); } }
/** * Constant instance that represents no changes. * @since 1.568 */ public static ChangeLogSet<? extends ChangeLogSet.Entry> createEmpty(Run build) { return new EmptyChangeLogSet(build); }
@Override public ChangeLogSet<? extends ChangeLogSet.Entry> parse(Run build, RepositoryBrowser<?> browser, File changelogFile) throws IOException, SAXException { return ChangeLogSet.createEmpty(build); }
public RepositoryBrowser get() { if (cacheGeneration == -1) { return cache; } SCMDescriptor<?> d = owner.getDescriptor(); RepositoryBrowser<?> dflt = owner.guessBrowser(); if (dflt != null) { cache = dflt; cacheGeneration = -1; return cache; } int g = d.generation; if(g!=cacheGeneration) { cacheGeneration = g; cache = infer(); } return cache; }
public String getEntryDescription(FeedItem item) { StringBuilder buf = new StringBuilder(); for (String path : item.e.getAffectedPaths()) buf.append(path).append('\n'); return buf.toString(); }
/** * Message escaped for HTML */ public String getMsgEscaped() { return Util.escape(getMsg()); }
@Deprecated public ChangeLogSet<? extends Entry> parse(AbstractBuild build, File changelogFile) throws IOException, SAXException { return parse((Run) build, build.getProject().getScm().getEffectiveBrowser(), changelogFile); } }
public static List<SCMDescriptor<?>> getSCMDescriptors(AbstractProject<?,?> project) { return SCM._for(project); }
/** * Unregisters this annotator, so that Hudson stops using this object. */ public final boolean unregister() { return all().remove(this); }
/** * Allows {@link SCMDescriptor}s to choose which projects it wants to be configurable against. * * <p> * When this method returns false, this {@link SCM} will not appear in the configuration screen * for the given project. The default is true for {@link AbstractProject} but false for {@link Job}. * * @since 1.568 */ public boolean isApplicable(Job project) { if (project instanceof AbstractProject) { return isApplicable((AbstractProject) project); } else { return false; } }
/** * Returns the list of {@link RepositoryBrowser} {@link Descriptor} * that can be used with this SCM. * * @return * can be empty but never null. */ public List<Descriptor<RepositoryBrowser<?>>> getBrowserDescriptors() { if(repositoryBrowser==null) return Collections.emptyList(); return RepositoryBrowsers.filter(repositoryBrowser); }
/** * Gets the SCM descriptor by name. Primarily used for making them web-visible. */ public Descriptor<SCM> getScm(String shortClassName) { return findDescriptor(shortClassName, SCM.all()); }
@Override public String getDisplayName() { return Messages.NullSCM_DisplayName(); }
/** * @deprecated as of 1.294 * Use {@link #parseSCM(StaplerRequest, AbstractProject)} and pass in the caller's project type. */ @Deprecated public static SCM parseSCM(StaplerRequest req) throws FormException, ServletException { return parseSCM(req,null); }
/** * Should create a key by which this SCM configuration might be distinguished from others in the same project. * Should be invariable across builds but otherwise as distinctive as possible. * <p>Could include information such as the relative paths used in {@link #getModuleRoots(FilePath, AbstractBuild)}, * and/or configured repository URLs and branch names, and/or labels set for this purpose by the user. * <p>The result may be used for various purposes, but it may be long and/or include URL-unsafe characters, * so to use in a URL path component you may need to first wrap it in {@link Util#getDigestOf(String)} or otherwise encode it. * @return by default, just {@link #getType} * @since 1.568 */ public @Nonnull String getKey() { return getType(); }
/** * Gets the repository browser descriptor by name. Primarily used for making them web-visible. */ public Descriptor<RepositoryBrowser<?>> getRepositoryBrowser(String shortClassName) { return findDescriptor(shortClassName,RepositoryBrowser.all()); }
/** * Get a chance to do operations after the workspace i checked out and the changelog is written. * @since 1.568 */ public void postCheckout(@Nonnull Run<?,?> build, @Nonnull Launcher launcher, @Nonnull FilePath workspace, @Nonnull TaskListener listener) throws IOException, InterruptedException { if (build instanceof AbstractBuild && listener instanceof BuildListener) { postCheckout((AbstractBuild) build, launcher, workspace, (BuildListener) listener); } }
@Deprecated protected ChangeLogSet(AbstractBuild<?, ?> build) { this((Run) build, browserFromBuild(build)); } private static RepositoryBrowser<?> browserFromBuild(AbstractBuild<?,?> build) {
@Deprecated public static ChangeLogSet<? extends ChangeLogSet.Entry> createEmpty(AbstractBuild build) { return createEmpty((Run) build); }