@Test public void testAnnotation() throws Exception { File root = new File(repository.getSourceRoot(), "rcs_test"); RCSRepository repo = (RCSRepository) RepositoryFactory.getRepository(root); File header = new File(root, "header.h"); Annotation annotation = repo.annotate(header, null); if (annotation != null) { Annotation expAnnotation = new Annotation(header.getName()); assertEquals(2, annotation.size()); expAnnotation.addLine("1.1", "kah", true); expAnnotation.addLine("1.1", "kah", true); assertEquals(expAnnotation.toString(), annotation.toString()); } }
@Override Annotation annotate(File file, String revision) throws IOException { List<String> argv = new ArrayList<>(); ensureCommand(CMD_BLAME_PROPERTY_KEY, CMD_BLAME_FALLBACK); argv.add(RepoCommand); if (revision != null) { argv.add("-r"); argv.add(revision); } argv.add(file.getName()); Executor executor = new Executor(argv, file.getParentFile(), RuntimeEnvironment.getInstance().getInteractiveCommandTimeout()); RCSAnnotationParser annotator = new RCSAnnotationParser(file); executor.exec(true, annotator); return annotator.getAnnotation(); }
RCSRepository extends Repository { @Override Annotation annotate(File file, String revision) throws IOException { List<String> argv = new ArrayList<>(); ensureCommand(CMD_BLAME_PROPERTY_KEY, CMD_BLAME_FALLBACK); argv.add(RepoCommand); if (revision != null) { argv.add("-r"); argv.add(revision); } argv.add(file.getName()); Executor executor = new Executor(argv, file.getParentFile(), RuntimeEnvironment.getInstance().getInteractiveCommandTimeout()); RCSAnnotationParser annotator = new RCSAnnotationParser(file); executor.exec(true, annotator); return annotator.getAnnotation(); } }
RCSRepository extends Repository { @Override Annotation annotate(File file, String revision) throws IOException { List<String> argv = new ArrayList<>(); ensureCommand(CMD_BLAME_PROPERTY_KEY, CMD_BLAME_FALLBACK); argv.add(RepoCommand); if (revision != null) { argv.add("-r"); argv.add(revision); } argv.add(file.getName()); Executor executor = new Executor(argv, file.getParentFile(), RuntimeEnvironment.getInstance().getInteractiveCommandTimeout()); RCSAnnotationParser annotator = new RCSAnnotationParser(file); executor.exec(true, annotator); return annotator.getAnnotation(); } RCSRepository(); }
RCSRepository extends Repository { @Override Annotation annotate(File file, String revision) throws IOException { List<String> argv = new ArrayList<>(); ensureCommand(CMD_BLAME_PROPERTY_KEY, CMD_BLAME_FALLBACK); argv.add(RepoCommand); if (revision != null) { argv.add("-r"); argv.add(revision); } argv.add(file.getName()); Executor executor = new Executor(argv, file.getParentFile(), RuntimeEnvironment.getInstance().getInteractiveCommandTimeout()); RCSAnnotationParser annotator = new RCSAnnotationParser(file); executor.exec(true, annotator); return annotator.getAnnotation(); } RCSRepository();  }
RCSRepository extends Repository { @Override Annotation annotate(File file, String revision) throws IOException { List<String> argv = new ArrayList<>(); ensureCommand(CMD_BLAME_PROPERTY_KEY, CMD_BLAME_FALLBACK); argv.add(RepoCommand); if (revision != null) { argv.add("-r"); argv.add(revision); } argv.add(file.getName()); Executor executor = new Executor(argv, file.getParentFile(), RuntimeEnvironment.getInstance().getInteractiveCommandTimeout()); RCSAnnotationParser annotator = new RCSAnnotationParser(file); executor.exec(true, annotator); return annotator.getAnnotation(); } RCSRepository();   }