@Test public void testGetHistoryBranch() throws Exception { setUpTestRepository(); File root = new File(repository.getSourceRoot(), "mercurial"); runHgCommand(root, "unbundle", Paths.get(getClass().getResource("/history/hg-branch.bundle").toURI()).toString()); runHgCommand(root, "update", "mybranch"); MercurialRepository mr = (MercurialRepository) RepositoryFactory.getRepository(root); History hist = mr.getHistory(root); List<HistoryEntry> entries = hist.getHistoryEntries(); List<String> both = new ArrayList<>(REVISIONS.length + REVISIONS_extra_branch.length); Collections.addAll(both, REVISIONS_extra_branch); Collections.addAll(both, REVISIONS); String revs[] = both.toArray(new String[both.size()]); assertEquals(revs.length, entries.size()); for (int i = 0; i < entries.size(); i++) { HistoryEntry e = entries.get(i); assertEquals(revs[i], e.getRevision()); assertNotNull(e.getAuthor()); assertNotNull(e.getDate()); assertNotNull(e.getFiles()); assertNotNull(e.getMessage()); } hist = mr.getHistory(root, "8:6a8c423f5624"); entries = hist.getHistoryEntries(); assertEquals(2, entries.size()); assertEquals(REVISIONS_extra_branch[0], entries.get(0).getRevision()); assertEquals(REVISIONS[0], entries.get(1).getRevision()); }
@Override History getHistory(File file) throws HistoryException { return getHistory(file, null); }
MercurialRepository extends Repository { @Override History getHistory(File file) throws HistoryException { return getHistory(file, null); } }
MercurialRepository extends Repository { @Override History getHistory(File file) throws HistoryException { return getHistory(file, null); } MercurialRepository(); }
MercurialRepository extends Repository { @Override History getHistory(File file) throws HistoryException { return getHistory(file, null); } MercurialRepository(); @Override Annotation annotate(File file, String revision); @Override boolean fileHasAnnotation(File file); @Override boolean fileHasHistory(File file); @Override boolean isWorking(); @Override String determineCurrentVersion(CommandTimeoutType cmdType); }
MercurialRepository extends Repository { @Override History getHistory(File file) throws HistoryException { return getHistory(file, null); } MercurialRepository(); @Override Annotation annotate(File file, String revision); @Override boolean fileHasAnnotation(File file); @Override boolean fileHasHistory(File file); @Override boolean isWorking(); @Override String determineCurrentVersion(CommandTimeoutType cmdType); static final String CMD_PROPERTY_KEY; static final String CMD_FALLBACK; static final String NOFOREST_PROPERTY_KEY; }