@Override protected void preUpdate(ModuleLocation module, File local) throws SVNException, IOException { listener.getLogger().println("Reverting " + local + " ignoreExternals: " + module.isIgnoreExternalsOption()); final SVNWCClient svnwc = manager.getWCClient(); svnwc.setIgnoreExternals(module.isIgnoreExternalsOption()); svnwc.doRevert(new File[]{local.getCanonicalFile()}, getSvnDepth(module.getDepthOption()), null); } }
@Override protected void preUpdate(ModuleLocation module, File local) throws SVNException, IOException { listener.getLogger().println("Reverting " + local + " ignoreExternals: " + module.isIgnoreExternalsOption()); final SVNWCClient svnwc = manager.getWCClient(); svnwc.setIgnoreExternals(module.isIgnoreExternalsOption()); svnwc.doRevert(new File[]{local.getCanonicalFile()}, getSvnDepth(module.getDepthOption()), null); } }
@Override protected void preUpdate(ModuleLocation module, File local) throws SVNException, IOException { listener.getLogger().println("Reverting " + local + " to depth " + module.getDepthOption() + " with ignoreExternals: " + module.isIgnoreExternalsOption()); final SVNWCClient svnwc = manager.getWCClient(); svnwc.setIgnoreExternals(module.isIgnoreExternalsOption()); svnwc.doRevert(new File[]{local.getCanonicalFile()}, module.getSvnDepthForRevert(), null); } }
for (final ModuleLocation l : locations) { location = l; SVNDepth svnDepth = getSvnDepth(l.getDepthOption()); SVNRevision revision = getRevision(l); if (listener != null) {
preUpdate(l, local); SVNDepth svnDepth = getSvnDepth(l.getDepthOption()); SVNRevision revision = getRevision(l);
preUpdate(l, local); SVNDepth svnDepth = getSvnDepth(l.getDepthOption()); SVNRevision revision = getRevision(l);
for (final ModuleLocation l : locations) { location = l; SVNDepth svnDepth = getSvnDepth(l.getDepthOption()); SVNRevision revision = getRevision(l); if (listener != null) {
preUpdate(l, local); SVNDepth svnDepth = getSvnDepth(l.getDepthOption()); SVNRevision revision = getRevision(l);
/** * If a subversion remote uses $VAR or ${VAR} as a parameterized build, * we expand the url. This will expand using the DEFAULT item. If there * is a choice parameter, it will expand with the FIRST item. */ public ModuleLocation getExpandedLocation(Job<?, ?> project) { String url = this.getURL(); String returnURL = url; for (JobProperty property : project.getProperties().values()) { if (property instanceof ParametersDefinitionProperty) { ParametersDefinitionProperty pdp = (ParametersDefinitionProperty) property; for (String propertyName : pdp.getParameterDefinitionNames()) { if (url.contains(propertyName)) { ParameterDefinition pd = pdp.getParameterDefinition(propertyName); ParameterValue pv = pd.getDefaultParameterValue(); String replacement = ""; if (pv != null) { replacement = String.valueOf(pv.createVariableResolver(null).resolve(propertyName)); } returnURL = returnURL.replace("${" + propertyName + "}", replacement); returnURL = returnURL.replace("$" + propertyName, replacement); } } } } return new ModuleLocation(returnURL, credentialsId, getLocalDir(), getDepthOption(), isIgnoreExternalsOption(), isCancelProcessOnExternalsFail()); }
/** * Returns the SVNDepth to use for checking out the module. * * This is normally the requested SVN depth except when the user * has requested as-it-is and then we use files so that we don't check * everything out. * * @return {@link org.tmatesoft.svn.core.SVNDepth} value. */ public SVNDepth getSvnDepthForCheckout() { if("unknown".equals(getDepthOption())) { return SVNDepth.FILES; } else if ("as-it-is-infinity".equals(getDepthOption())){ return SVNDepth.INFINITY; } else { return getSvnDepth(getDepthOption()); } }
/** * Returns the SVNDepth to use for reverting the module if svn up with revert before is selected * * This is normally the requested SVN depth except when the user * has requested as-it-is and then we use infinity to actually revert everything * * @return {@link org.tmatesoft.svn.core.SVNDepth} value. */ public SVNDepth getSvnDepthForRevert() { if("unknown".equals(getDepthOption()) || "as-it-is-infinity".equals(getDepthOption())){ return SVNDepth.INFINITY; }else { return getSvnDepth(getDepthOption()); } }
/** * Returns the SVNDepth to use for updating the module. * * This is just mapping the depthOption to an SVN Depth * * @return {@link org.tmatesoft.svn.core.SVNDepth} value. */ public SVNDepth getSvnDepthForUpdate() { return getSvnDepth(getDepthOption()); }
/** * Expand location value based on environment variables. * * @return Output ModuleLocation expanded according to specified env vars. */ public ModuleLocation getExpandedLocation(EnvVars env) { return new ModuleLocation(env.expand(remote), credentialsId, env.expand(getLocalDir()), getDepthOption(), isIgnoreExternalsOption(), isCancelProcessOnExternalsFail()); }
/** * Expand location value based on Build parametric execution. * * @param build Build instance for expanding parameters into their values * @return Output ModuleLocation expanded according to Build parameters * values. */ public ModuleLocation getExpandedLocation(AbstractBuild<?, ?> build) { return new ModuleLocation(getExpandedRemote(build), getLocalDir(), getDepthOption(), isIgnoreExternalsOption()); }
/** * Expand location value based on Build parametric execution. * * @param build Build instance for expanding parameters into their values * @return Output ModuleLocation expanded according to Build parameters * values. */ public ModuleLocation getExpandedLocation(AbstractBuild<?, ?> build) { return new ModuleLocation(getExpandedRemote(build), getLocalDir(), getDepthOption(), isIgnoreExternalsOption()); }