@Test public void parseEmpty() throws Exception { History result = instance.parse("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<log>\n" + "</log>"); assertNotNull(result); assertNotNull(result.getHistoryEntries()); assertTrue("Should not contain any history entries", 0 == result.getHistoryEntries().size()); }
History parse(File file, SubversionRepository repos, String sinceRevision, int numEntries, CommandTimeoutType cmdType) throws HistoryException { initSaxParser(); handler = new Handler(repos.getDirectoryName(), repos.reposPath, RuntimeEnvironment.getInstance().getSourceRootPath().length(), repos); Executor executor; try { executor = repos.getHistoryLogExecutor(file, sinceRevision, numEntries, cmdType); } catch (IOException e) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\"", e); } int status = executor.exec(true, this); if (status != 0) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\" Exit code: " + status); } List<HistoryEntry> entries = handler.entries; if (sinceRevision != null) { repos.removeAndVerifyOldestChangeset(entries, sinceRevision); } return new History(entries, handler.getRenamedFiles()); }
SubversionHistoryParser implements Executor.StreamHandler { History parse(File file, SubversionRepository repos, String sinceRevision, int numEntries, CommandTimeoutType cmdType) throws HistoryException { initSaxParser(); handler = new Handler(repos.getDirectoryName(), repos.reposPath, RuntimeEnvironment.getInstance().getSourceRootPath().length(), repos); Executor executor; try { executor = repos.getHistoryLogExecutor(file, sinceRevision, numEntries, cmdType); } catch (IOException e) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\"", e); } int status = executor.exec(true, this); if (status != 0) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\" Exit code: " + status); } List<HistoryEntry> entries = handler.entries; if (sinceRevision != null) { repos.removeAndVerifyOldestChangeset(entries, sinceRevision); } return new History(entries, handler.getRenamedFiles()); } }
SubversionHistoryParser implements Executor.StreamHandler { History parse(File file, SubversionRepository repos, String sinceRevision, int numEntries, CommandTimeoutType cmdType) throws HistoryException { initSaxParser(); handler = new Handler(repos.getDirectoryName(), repos.reposPath, RuntimeEnvironment.getInstance().getSourceRootPath().length(), repos); Executor executor; try { executor = repos.getHistoryLogExecutor(file, sinceRevision, numEntries, cmdType); } catch (IOException e) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\"", e); } int status = executor.exec(true, this); if (status != 0) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\" Exit code: " + status); } List<HistoryEntry> entries = handler.entries; if (sinceRevision != null) { repos.removeAndVerifyOldestChangeset(entries, sinceRevision); } return new History(entries, handler.getRenamedFiles()); }  }
SubversionHistoryParser implements Executor.StreamHandler { History parse(File file, SubversionRepository repos, String sinceRevision, int numEntries, CommandTimeoutType cmdType) throws HistoryException { initSaxParser(); handler = new Handler(repos.getDirectoryName(), repos.reposPath, RuntimeEnvironment.getInstance().getSourceRootPath().length(), repos); Executor executor; try { executor = repos.getHistoryLogExecutor(file, sinceRevision, numEntries, cmdType); } catch (IOException e) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\"", e); } int status = executor.exec(true, this); if (status != 0) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\" Exit code: " + status); } List<HistoryEntry> entries = handler.entries; if (sinceRevision != null) { repos.removeAndVerifyOldestChangeset(entries, sinceRevision); } return new History(entries, handler.getRenamedFiles()); }  @Override void processStream(InputStream input); }
SubversionHistoryParser implements Executor.StreamHandler { History parse(File file, SubversionRepository repos, String sinceRevision, int numEntries, CommandTimeoutType cmdType) throws HistoryException { initSaxParser(); handler = new Handler(repos.getDirectoryName(), repos.reposPath, RuntimeEnvironment.getInstance().getSourceRootPath().length(), repos); Executor executor; try { executor = repos.getHistoryLogExecutor(file, sinceRevision, numEntries, cmdType); } catch (IOException e) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\"", e); } int status = executor.exec(true, this); if (status != 0) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\" Exit code: " + status); } List<HistoryEntry> entries = handler.entries; if (sinceRevision != null) { repos.removeAndVerifyOldestChangeset(entries, sinceRevision); } return new History(entries, handler.getRenamedFiles()); }  @Override void processStream(InputStream input);  }