private void debugRange() { LOGGER.debug( "Limiting data to range: " + (config.getStart() == null ? "first-commit" : config.getStart()) + " - " + (config.getEnd() == null ? "most-recent-commit" : config.getEnd())); }
private void printLimitedRange(final BranchInfo... bis) { debugRange(); for (final BranchInfo bi : bis) { final AuthorInfoBuilder aib = bi.getAuthorStatistics() .limitToDateRange(Util.getAppropriateRange(config.getStart(), config.getEnd())); out.println(aib); } }
private void analyzeAsGit() throws GitAPIException { final UsernamePasswordCredentialsProvider cp = new UsernamePasswordCredentialsProvider(config.getUsername(), config.getPassword()); final GitRepo repo = new GitRepo(config.getUrl(), config.getBranch(), false, cp); repo.sync(config.getBranch(), config.shouldGenerateStats(), config.shouldUseCloc()); if (!(config.getStart() == null && config.getEnd() == null)) { if (config.getBranch() != null) { printLimitedRange(repo.getRepoStatistics().getBranchInfoFor(config.getBranch())); } else { printLimitedRange(repo.getRepoStatistics().getBranchInfos()); } } else { out.println(repo.getRepoStatistics().toString(config.shouldShowCommits())); } repo.close(); }
/** * Treats the url as a svn repo * * @throws SVNException * @throws BranchNotFoundException */ private void analyzeAsSVN() throws SVNException, BranchNotFoundException { if (config.shouldForceSvn()) { LOGGER.debug("Force running as SVN"); } final SVNRepo repo = new SVNRepo( config.getUrl(), config.getBranch(), config.getUsername(), config.getPassword(), false, false); repo.setLogEntryCacheDisabled(config.svnIgnoreCache); repo.sync( config.getBranch(), config.shouldGetLangStats(), config.shouldGenerateStats(), config.getRevA(), config.getRevB()); if (!(config.getStart() == null && config.getEnd() == null)) { if (config.getBranch() != null) { printLimitedRange(repo.getRepoStatistics().getBranchInfoFor(config.getBranch())); } else { printLimitedRange(repo.getRepoStatistics().getBranchInfos()); } } else { out.println(repo.getRepoStatistics().toString(config.shouldShowCommits())); } }