/** * @since 1.568 */ public ChangeLogSet<? extends Entry> parse(Run build, RepositoryBrowser<?> browser, File changelogFile) throws IOException, SAXException { if (build instanceof AbstractBuild && Util.isOverridden(ChangeLogParser.class, getClass(), "parse", AbstractBuild.class, File.class)) { return parse((AbstractBuild) build, changelogFile); } else { throw new AbstractMethodError("You must override the newer overload of parse"); } }
private ChangeLogSet<? extends Entry> calcChangeSet() { File changelogFile = new File(getRootDir(), "changelog.xml"); if (!changelogFile.exists()) return ChangeLogSet.createEmpty(this); try { return scm.parse(this,changelogFile); } catch (IOException e) { LOGGER.log(WARNING, "Failed to parse "+changelogFile,e); } catch (SAXException e) { LOGGER.log(WARNING, "Failed to parse "+changelogFile,e); } return ChangeLogSet.createEmpty(this); }
@Deprecated public ChangeLogSet<? extends Entry> parse(AbstractBuild build, File changelogFile) throws IOException, SAXException { return parse((Run) build, build.getProject().getScm().getEffectiveBrowser(), changelogFile); } }
ChangeLogParser parser = ChangeLogParserFactory.getInstance().getParser("src/main/resources/changelog.xml", resourceAccessor); DatabaseChangeLog databaseChangeLog = parser.parse("src/main/resources/changelog.xml", new ChangeLogParameters(), resourceAccessor);
private ChangeLogSet<? extends Entry> calcChangeSet() { File changelogFile = new File(getRootDir(), "changelog.xml"); if (!changelogFile.exists()) return ChangeLogSet.createEmpty(this); try { return scm.parse(this,changelogFile); } catch (IOException e) { LOGGER.log(WARNING, "Failed to parse "+changelogFile,e); } catch (SAXException e) { LOGGER.log(WARNING, "Failed to parse "+changelogFile,e); } return ChangeLogSet.createEmpty(this); }
/** * @since 1.568 */ public ChangeLogSet<? extends Entry> parse(Run build, RepositoryBrowser<?> browser, File changelogFile) throws IOException, SAXException { if (build instanceof AbstractBuild && Util.isOverridden(ChangeLogParser.class, getClass(), "parse", AbstractBuild.class, File.class)) { return parse((AbstractBuild) build, changelogFile); } else { throw new AbstractMethodError("You must override the newer overload of parse"); } }
private ChangeLogSet<? extends Entry> calcChangeSet() { File changelogFile = new File(getRootDir(), "changelog.xml"); if (!changelogFile.exists()) return ChangeLogSet.createEmpty(this); try { return scm.parse(this,changelogFile); } catch (IOException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } return ChangeLogSet.createEmpty(this); }
private ChangeLogSet<? extends Entry> calcChangeSet() { File changelogFile = new File(getRootDir(), "changelog.xml"); if (!changelogFile.exists()) return ChangeLogSet.createEmpty(this); try { return scm.parse(this,changelogFile); } catch (IOException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } return ChangeLogSet.createEmpty(this); }
private ChangeLogSet<? extends Entry> calcChangeSet() { File changelogFile = new File(getRootDir(), "changelog.xml"); if (!changelogFile.exists()) return ChangeLogSet.createEmpty(this); try { return scm.parse(this,changelogFile); } catch (IOException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } return ChangeLogSet.createEmpty(this); }
private ChangeLogSet<? extends Entry> calcChangeSet() { File changelogFile = new File(getRootDir(), "changelog.xml"); if (!changelogFile.exists()) { return ChangeLogSet.createEmpty(this); } try { return scm.parse(this, changelogFile); } catch (IOException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } return ChangeLogSet.createEmpty(this); }
@Deprecated public ChangeLogSet<? extends Entry> parse(AbstractBuild build, File changelogFile) throws IOException, SAXException { return parse((Run) build, build.getProject().getScm().getEffectiveBrowser(), changelogFile); } }
@Override @Exported public synchronized List<ChangeLogSet<? extends ChangeLogSet.Entry>> getChangeSets() { if (changeSets == null) { changeSets = new ArrayList<>(); for (SCMCheckout co : checkouts(null)) { if (co.changelogFile != null && co.changelogFile.isFile()) { try { ChangeLogSet<? extends ChangeLogSet.Entry> changeLogSet = co.scm.createChangeLogParser().parse(this, co.scm.getEffectiveBrowser(), co.changelogFile); if (!changeLogSet.isEmptySet()) { changeSets.add(changeLogSet); } } catch (Exception x) { LOGGER.log(Level.WARNING, "could not parse " + co.changelogFile, x); } } } } return changeSets; }
private void onCheckout(SCM scm, FilePath workspace, TaskListener listener, @CheckForNull File changelogFile, @CheckForNull SCMRevisionState pollingBaseline) throws Exception { if (changelogFile != null && changelogFile.isFile()) { ChangeLogSet<?> cls = scm.createChangeLogParser().parse(this, scm.getEffectiveBrowser(), changelogFile); if (!cls.isEmptySet()) { getChangeSets().add(cls); } for (SCMListener l : SCMListener.all()) { l.onChangeLogParsed(this, scm, listener, cls); } } checkouts(listener).add(new SCMCheckout(scm, FilePathUtils.getNodeName(workspace), workspace.getRemote(), changelogFile, pollingBaseline)); }
@Bug(16332) @Test public void parseAddressFromChangeLog() throws Exception { File changelogXml = tmp.newFile("changelog.xml"); PrintWriter pw = new PrintWriter(changelogXml, "UTF-8"); try { pw.println("<?xml version='1.0' encoding='UTF-8'?>"); pw.println("<changesets>"); pw.println("<changeset author='joe.schmo <joe.schmo@example.com>'/>"); pw.println("</changesets>"); pw.flush(); } finally { pw.close(); } ChangeLogParser clp = new MercurialChangeLogParser(null); ChangeLogSet<? extends ChangeLogSet.Entry> cls = clp.parse(null, null, changelogXml); Iterator<? extends ChangeLogSet.Entry> it = cls.iterator(); assertTrue(it.hasNext()); ChangeLogSet.Entry entry = it.next(); assertFalse(it.hasNext()); User author = entry.getAuthor(); assertEquals("joe.schmo _joe.schmo@example.com_", author.getId()); assertEquals("joe.schmo <joe.schmo@example.com>", author.getFullName()); }