public String getIconFileName() { if (!isTagged() && !getACL().hasPermission(getPermission())) return null; return "save.gif"; }
/** * Creates a URL, to be used as the default value of the module tag URL. * * @return * null if failed to guess. */ public String makeTagURL(SvnInfo si) { // assume the standard trunk/branches/tags repository layout Matcher m = TRUNK_BRANCH_MARKER.matcher(si.url); if(!m.find()) return null; // doesn't have 'trunk' nor 'branches' return si.url.substring(0,m.start())+"/tags/"+getBuild().getProject().getName()+"-"+getBuild().getNumber(); }
@Override public Action getAction(AbstractBuild<?,?> build, TaskListener listener) { SubversionTagAction tagAction = build.getAction(SubversionTagAction.class); if (tagAction == null) { listener.getLogger().println( "[parameterizedtrigger] no SubversionTagAction found -- is this project an SVN project ?"); return null; } List<SvnInfo> infos = new ArrayList<SvnInfo>(tagAction.getTags().keySet()); return new RevisionParameterAction(infos); }
/** * Invoked to actually tag the workspace. */ public synchronized void doSubmit(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { getACL().checkPermission(getPermission()); MultipartFormDataParser parser = new MultipartFormDataParser(req); Map<SvnInfo, String> newTags = new HashMap<SvnInfo, String>(); int i = -1; for (SvnInfo e : tags.keySet()) { i++; if (tags.size() > 1 && parser.get("tag" + i) == null) continue; // when tags.size()==1, UI won't show the checkbox. newTags.put(e, parser.get("name" + i)); } UserProvidedCredential upc = null; if (parser.get("credential") != null) upc = UserProvidedCredential.fromForm(req, parser); new TagWorkerThread(newTags, upc, parser.get("comment")).start(); rsp.sendRedirect("."); }
assertFalse("Shouldn't be accessible to anonymous user",b.hasPermission(action.getPermission())); return null; });
/** * Was any tag created by the user already? */ public boolean hasTags() { return isTagged(); }
public boolean checkout(AbstractBuild build, Launcher launcher, FilePath workspace, final BuildListener listener, File changelogFile) throws IOException, InterruptedException { List<External> externals = checkout(build, workspace, listener); if (externals == null) { return false; } // write out the revision file PrintWriter w = new PrintWriter(new FileOutputStream(getRevisionFile(build))); try { Map<String, SvnInfo> revMap = workspace.act(new BuildRevisionMapTask(build, this, listener, externals)); for (Entry<String, SvnInfo> e : revMap.entrySet()) { w.println(e.getKey() + '/' + e.getValue().revision); } build.addAction(new SubversionTagAction(build, revMap.values())); } finally { w.close(); } // write out the externals info new XmlFile(External.XSTREAM, getExternalsFile(build.getProject())).write(externals); return calcChangeLog(build, changelogFile, listener, externals); }
/** * Invoked to actually tag the workspace. */ public synchronized void doSubmit(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { getACL().checkPermission(getPermission()); MultipartFormDataParser parser = new MultipartFormDataParser(req); Map<SvnInfo,String> newTags = new HashMap<SvnInfo,String>(); int i=-1; for (SvnInfo e : tags.keySet()) { i++; if(tags.size()>1 && parser.get("tag"+i)==null) continue; // when tags.size()==1, UI won't show the checkbox. newTags.put(e,parser.get("name" + i)); } UserProvidedCredential upc=null; if (parser.get("credential")!=null) upc = UserProvidedCredential.fromForm(req,parser); new TagWorkerThread(newTags,upc,parser.get("comment")).start(); rsp.sendRedirect("."); }
/** * Was any tag created by the user already? */ public boolean hasTags() { return isTagged(); }
public boolean checkout(AbstractBuild build, Launcher launcher, FilePath workspace, final BuildListener listener, File changelogFile) throws IOException, InterruptedException { List<External> externals = checkout(build, workspace, listener); if (externals == null) { return false; } // write out the revision file PrintWriter w = new PrintWriter(new FileOutputStream(getRevisionFile(build))); try { Map<String, SvnInfo> revMap = workspace.act(new BuildRevisionMapTask(build, this, listener, externals)); for (Entry<String, SvnInfo> e : revMap.entrySet()) { w.println(e.getKey() + '/' + e.getValue().revision); } build.addAction(new SubversionTagAction(build, revMap.values())); } finally { w.close(); } // write out the externals info new XmlFile(External.XSTREAM, getExternalsFile(build.getProject())).write(externals); return calcChangeLog(build, changelogFile, listener, externals); }
public String getIconFileName() { if(!isTagged() && !getACL().hasPermission(getPermission())) return null; return "save.gif"; }
getACL().checkPermission(getPermission());
/** * Creates a URL, to be used as the default value of the module tag URL. * * @return * null if failed to guess. */ public String makeTagURL(SvnInfo si) { // assume the standard trunk/branches/tags repository layout Matcher m = TRUNK_BRANCH_MARKER.matcher(si.url); if(!m.find()) return null; // doesn't have 'trunk' nor 'branches' return si.url.substring(0,m.start())+"/tags/"+getBuild().getProject().getName()+"-"+getBuild().getNumber(); }
/** * Was any tag created by the user already? */ public boolean hasTags() { return isTagged(); }
@Override public Action getAction(AbstractBuild<?,?> build, TaskListener listener) { SubversionTagAction tagAction = build.getAction(SubversionTagAction.class); RevisionParameterAction revisionAction = build.getAction(RevisionParameterAction.class); List<SvnInfo> infos = new ArrayList<SvnInfo>(); if (tagAction == null ) { listener.getLogger().println( Plugin.LOG_TAG + " no SubversionTagAction found -- is this project an SVN project ?"); } else { infos.addAll(tagAction.getTags().keySet()); } if(includeUpstreamParameters == true) { if (revisionAction == null ) { listener.getLogger().println( Plugin.LOG_TAG + " no RevisionParameterAction found -- project did not have SVN parameters passed to it?"); } else { infos.addAll(revisionAction.getRevisions()); } } //if infos is empty don't return an action. return (infos.size() == 0 ) ? null : new RevisionParameterAction(infos); }
revList.add(p.info); build.addAction(new SubversionTagAction(build,revList)); } finally { w.close();
public String getIconFileName() { if(!isTagged() && !getACL().hasPermission(getPermission())) return null; return "save.gif"; }
/** * Creates a URL, to be used as the default value of the module tag URL. * * @return null if failed to guess. */ public String makeTagURL(SvnInfo si) { // assume the standard trunk/branches/tags repository layout Matcher m = TRUNK_BRANCH_MARKER.matcher(si.url); if (!m.find()) return null; // doesn't have 'trunk' nor 'branches' return si.url.substring(0, m.start()) + "/tags/" + getBuild().getProject().getName() + "-" + getBuild().getNumber(); }
List<DomainRequirement> domainRequirements = Collections.<DomainRequirement>emptyList(); if (action != null) { for (SvnInfo info: action.getTags().keySet()) { domainRequirements = URIRequirementBuilder.fromUri(info.url).build(); break;
final SVNClientManager cm = upc!=null ? SVNClientManager.newInstance(SVNWCUtil.createDefaultOptions(true),upc.new AuthenticationManagerImpl(listener)) : SubversionSCM.createSvnClientManager(getBuild().getProject()); try { for (Entry<SvnInfo, String> e : tagSet.entrySet()) { getBuild().save(); workerThread = null; } finally {