@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); } }
@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); } }
fmt.format(r.getDate()) : r.toString(); svnuc.setIgnoreExternals(location.isIgnoreExternalsOption()); preUpdate(location, local); SVNDepth svnDepth = location.getSvnDepthForUpdate();
listener.getLogger().println("Checking out " + l.remote + " revision: " + (revision != null ? revision.toString() : "null") + " depth:" + svnDepth + " ignoreExternals: " + l.isIgnoreExternalsOption()); svnuc.setIgnoreExternals(l.isIgnoreExternalsOption());
svnuc.setEventHandler(eventHandler); svnuc.setExternalsHandler(eventHandler); svnuc.setIgnoreExternals(location.isIgnoreExternalsOption()); SVNDepth svnDepth = location.getSvnDepthForCheckout(); SvnCheckout checkout = svnuc.getOperationsFactory().createCheckout(); checkout.setRevision(r); checkout.setAllowUnversionedObstructions(true); checkout.setIgnoreExternals(location.isIgnoreExternalsOption()); checkout.setExternalsHandler(SvnCodec.externalsHandler(svnuc.getExternalsHandler()));
svnuc.setExternalsHandler(handler); svnuc.setIgnoreExternals(l.isIgnoreExternalsOption()); preUpdate(l, local); " ignoreExternals: " + l.isIgnoreExternalsOption()); svnuc.doSwitch(local.getCanonicalFile(), l.getSVNURL(), SVNRevision.HEAD, revision, svnDepth, true, false); } catch (final SVNException e) {
svnuc.setExternalsHandler(handler); svnuc.setIgnoreExternals(l.isIgnoreExternalsOption()); preUpdate(l, local); " ignoreExternals: " + l.isIgnoreExternalsOption()); svnuc.doUpdate(local.getCanonicalFile(), revision, svnDepth, true, false); } catch (final SVNException e) {
listener.getLogger().println("Checking out " + l.remote + " revision: " + (revision != null ? revision.toString() : "null") + " depth:" + svnDepth + " ignoreExternals: " + l.isIgnoreExternalsOption()); svnuc.setIgnoreExternals(l.isIgnoreExternalsOption()); svnuc.setEventHandler( new SubversionUpdateEventHandler(new PrintStream(pos), externals, local, l.getLocalDir()));
svnuc.setEventHandler(new SubversionUpdateEventHandler(listener.getLogger(), externals, local, l.getLocalDir())); svnuc.setIgnoreExternals(l.isIgnoreExternalsOption()); preUpdate(l, local); " ignoreExternals: " + l.isIgnoreExternalsOption()); svnuc.doUpdate(local.getCanonicalFile(), revision, svnDepth, true, false);
/** * 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()); }
/** * 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()); }