@Test public void testRenamedSingleHistory() throws Exception { RuntimeEnvironment.getInstance().setHandleHistoryOfRenamedFiles(true); File root = new File(repository.getSourceRoot(), "git"); GitRepository gitrepo = (GitRepository) RepositoryFactory.getRepository(root); History history = gitrepo.getHistory(new File(root.getAbsolutePath(), "moved2/renamed2.c")); Assert.assertNotNull(history); Assert.assertNotNull(history.getHistoryEntries()); Assert.assertEquals(5, history.getHistoryEntries().size()); Assert.assertNotNull(history.getRenamedFiles()); Assert.assertEquals(3, history.getRenamedFiles().size()); Assert.assertTrue(history.isRenamed("moved/renamed2.c")); Assert.assertTrue(history.isRenamed("moved2/renamed2.c")); Assert.assertTrue(history.isRenamed("moved/renamed.c")); Assert.assertFalse(history.isRenamed("non-existent.c")); Assert.assertFalse(history.isRenamed("renamed.c")); Assert.assertEquals("84599b3c", history.getHistoryEntries().get(0).getRevision()); Assert.assertEquals("67dfbe26", history.getHistoryEntries().get(1).getRevision()); Assert.assertEquals("1086eaf5", history.getHistoryEntries().get(2).getRevision()); Assert.assertEquals("b6413947", history.getHistoryEntries().get(3).getRevision()); Assert.assertEquals("ce4c98ec", history.getHistoryEntries().get(4).getRevision()); }
@Override History getHistory(File file) throws HistoryException { return getHistory(file, null); }
GitRepository extends Repository { @Override History getHistory(File file) throws HistoryException { return getHistory(file, null); } }
GitRepository extends Repository { @Override History getHistory(File file) throws HistoryException { return getHistory(file, null); } GitRepository(); }
GitRepository extends Repository { @Override History getHistory(File file) throws HistoryException { return getHistory(file, null); } GitRepository(); @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); }
GitRepository extends Repository { @Override History getHistory(File file) throws HistoryException { return getHistory(file, null); } GitRepository(); @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; }