use of org.tmatesoft.svn.core.SVNException in project Gargoyle by callakrsos.
the class SVNLog method logFileSystem.
/********************************
* 작성일 : 2016. 7. 13. 작성자 : KYJ
*
*
* @param path
* @param startRevision
* @param endDate
* @param exceptionHandler
* @return
********************************/
public List<SVNLogEntry> logFileSystem(File[] path, long startRevision, Date endDate, Consumer<Exception> exceptionHandler) {
SVNLogClient logClient = getSvnManager().getLogClient();
List<SVNLogEntry> result = new ArrayList<>();
try {
ISVNLogEntryHandler handler = logEntry -> {
LOGGER.debug("path :: {} rivision :: {} date :: {} author :: {} message :: {} ", path, logEntry.getRevision(), logEntry.getDate(), logEntry.getAuthor(), logEntry.getMessage());
result.add(logEntry);
};
doLog(path, startRevision, endDate, logClient, handler);
} catch (SVNException e) {
LOGGER.error(ValueUtil.toString(e));
if (exceptionHandler != null)
exceptionHandler.accept(e);
}
return result;
}
use of org.tmatesoft.svn.core.SVNException in project Gargoyle by callakrsos.
the class SVNLog method log.
/********************************
* 작성일 : 2016. 5. 5. 작성자 : KYJ
*
* 이력정보 조회
*
* @param path
* 상대경로
* @param revision
* 리비젼번호
* @param exceptionHandler
* 에러발생시 처리할 핸들 정의
* @return
********************************/
public List<SVNLogEntry> log(String path, String revision, Consumer<Exception> exceptionHandler) {
SVNLogClient logClient = getSvnManager().getLogClient();
List<SVNLogEntry> result = new ArrayList<>();
try {
ISVNLogEntryHandler handler = logEntry -> {
LOGGER.debug("rivision :: {} date :: {} author :: {} message :: {} ", logEntry.getRevision(), logEntry.getDate(), logEntry.getAuthor(), logEntry.getMessage());
result.add(logEntry);
};
String _path = path;
try {
_path = URLDecoder.decode(_path, "UTF-8");
} catch (Exception e) {
e.printStackTrace();
}
logClient.doLog(getSvnURL(), new String[] { _path }, SVNRevision.create(Long.parseLong(revision)), SVNRevision.create(Long.parseLong(revision) == -1 ? 0 : Long.parseLong(revision)), SVNRevision.HEAD, true, false, 100L, handler);
} catch (SVNException e) {
if (exceptionHandler != null)
exceptionHandler.accept(e);
else
LOGGER.error(ValueUtil.toString(e));
}
return result;
}
use of org.tmatesoft.svn.core.SVNException in project Gargoyle by callakrsos.
the class AbstractSVN method init.
/**
* 접속정보 초기화
*
* @작성자 : KYJ
* @작성일 : 2016. 5. 2.
* @param properties
*/
public void init(Properties properties) {
validate();
try {
svnURL = SVNURL.parseURIEncoded(getUrl());
repository = SVNRepositoryFactory.create(svnURL);
if ((getUserId() == null && getUserPassword() == null) || (getUserId().isEmpty() && getUserPassword().isEmpty())) {
authManager = SVNWCUtil.createDefaultAuthenticationManager(SVNWCUtil.getDefaultConfigurationDirectory());
} else {
authManager = SVNWCUtil.createDefaultAuthenticationManager(getUserId(), getUserPassword().toCharArray());
}
repository.setAuthenticationManager(authManager);
DefaultSVNOptions options = new DefaultSVNOptions();
svnManager = SVNClientManager.newInstance(options, authManager);
// svnManager.dispose();
// repository.closeSession();
} catch (SVNException e) {
LOGGER.error(ValueUtil.toString(e));
// throw new RuntimeException(e);
}
}
use of org.tmatesoft.svn.core.SVNException in project Gargoyle by callakrsos.
the class ScmCommitComposite method load.
public void load() {
try {
scmHistoryWalk();
getBarChartDayOfMonthCategory().setLabel("기간별 커밋 통계");
getLineChartDayOfWeekCategory().setLabel("요일별 커밋 통계");
getBarChartDayOfMonthCategory().getCategories().add(SERIES_LABEL);
getLineChartDayOfWeekCategory().getCategories().add(SERIES_LABEL);
Color lineColor = Color.GREEN;
double strokeWidth = 1;
String cssStyleClassName = ".chart-series-line";
{
/*start Desing css.*/
BarChart<String, Long> barChartDayOfMonth = getBarChartDayOfMonth();
String style = "-fx-bar-fill: ".concat(FxUtil.toWebString(lineColor)).concat(";");
for (Node n : barChartDayOfMonth.lookupAll(".default-color0.chart-bar")) {
n.setStyle(style);
}
// barChartDayOfMonth.setStyle(
// ".chart-legend-item-syCmbol chart-bar series0 bar-legend-symbol default-color0{- fx-background-color:green;}");
/*end Desing css.*/
/*start Popover*/
//무조건 1개의 시리즈만 처리하므로 인덱스에서 바로 가져옴.
ObservableList<Data<String, Long>> dataArr = getBarChartDayOfMonth().getData().get(0).getData();
for (Data<String, Long> d : dataArr) {
d.getNode().setOnMouseClicked(ev -> {
if (ev.getClickCount() == 1 && ev.getButton() == MouseButton.PRIMARY)
createPopOver(d);
});
}
barChartDayOfMonth.setMinWidth(BarChart.USE_COMPUTED_SIZE);
barChartDayOfMonth.requestLayout();
/*end Popover*/
}
{
LineChart<String, Long> lineChartDayOfWeek = getLineChartDayOfWeek();
lineChartDayOfWeek.setStyle(".chart-series-line .series0 .default-color0{- fx-background-color:green;}");
Set<Node> lookupAll = lineChartDayOfWeek.lookupAll(".chart-line-symbol");
StringBuffer sb = new StringBuffer();
sb.append("-fx-background-color: " + FxUtil.toRgbString(lineColor) + ", white;");
sb.append(" -fx-background-insets: 0, 2;");
sb.append("-fx-background-radius: 5px;");
sb.append("-fx-padding: 5px;");
for (Node n : lookupAll) {
n.setStyle(sb.toString());
}
String style = "-fx-stroke: " + FxUtil.toRgbString(lineColor) + "; -fx-stroke-width: " + strokeWidth + ";";
for (Node seriesLine : lineChartDayOfWeek.lookupAll(cssStyleClassName)) {
seriesLine.setStyle(style);
}
}
} catch (SVNException e) {
LOGGER.error(ValueUtil.toString(e));
}
}
use of org.tmatesoft.svn.core.SVNException in project Gargoyle by callakrsos.
the class SVNHistoryWalkTest method historyWalkAnalysisGroupingTest.
@Test
public void historyWalkAnalysisGroupingTest() throws SVNException {
List<GagoyleDate> periodDaysByWeek = DateUtil.getPeriodDaysByWeek();
GagoyleDate start = periodDaysByWeek.get(0);
GagoyleDate end = periodDaysByWeek.get(periodDaysByWeek.size() - 1);
Calendar instance = Calendar.getInstance();
instance.set(2016, 6, 1);
Date time = instance.getTime();
long startRevision = localServerManager2.getRevision(/*start.toDate()*/
time);
long endRevision = localServerManager2.getRevision(end.toDate());
System.out.println("start " + start.toDateString() + " end : " + end.toDateString());
System.out.println("startRevision " + startRevision + " endRevision : " + endRevision);
Collection<SVNLogEntry> allLogs = localServerManager2.getAllLogs(startRevision, endRevision);
// allLogs.
SimpleDateFormat format = new SimpleDateFormat(DateUtil.SYSTEM_DATEFORMAT_YYYY_MM_DD);
TreeMap<String, Long> collect = allLogs.stream().collect(Collectors.groupingBy(v -> format.format(v.getDate()), TreeMap::new, Collectors.mapping(v -> 1, Collectors.counting())));
// Map<String, Long> collect = allLogs.stream()
// .collect(Collectors.groupingBy(v -> format.format(v.getDate()), Collectors.mapping(v -> 1, Collectors.counting())));
System.out.println(collect);
}
Aggregations