private void analyze() throws GitAPIException, SVNException { if (config.getUrl() == null) { out.println(); } else { ClocService.init(); if (config.shouldForceGit()) { analyzeAsGit(); } else if (config.shouldForceSvn()) { analyzeAsSVN(); } else { if (config.getUrl().endsWith(".git")) { analyzeAsGit(); } else { analyzeAsSVN(); } } } }
/** * 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())); } }