private void writeLogEntry(PrintWriter out, LogEntry logEntry) { if (logEntry.getEntriesCount() == 0) { return; } String message = logEntry.getMessage().replace(QUOTE_CHARACTER, QUOTE_SPECIAL_CHARACTER); message = message.replace(ANGLE_OPENING_BRACKET_CHARACTER, ANGLE_OPENING_BRACKET_SPECIAL_CHARACTER); message = message.replace(ANGLE_CLOSING_BRACKET_CHARACTER, ANGLE_CLOSING_BRACKET_SPECIAL_CHARACTER); out.println( MessageFormat.format( LOGENTRY_START_NODE, new String[] {message, Integer.toString(logEntry.getRevision()), logEntry.getDate()})); List<PathEntry> pathEntries = logEntry.getPathEntries(); for (PathEntry pathEntry : pathEntries) { out.println( MessageFormat.format( PATH_NODE, new String[] {pathEntry.getAction(), pathEntry.getPath()})); } out.println(LOGENTRY_END_NODE); }
public static Multimap<Date, LogEntry> groupByTime(Collection<LogEntry> entries) { Multimap<Date, LogEntry> time2Entries = TreeMultimap.create(); for (LogEntry entry : entries) { time2Entries.put(entry.getDate(), entry); } return time2Entries; }
public SvnFileRevision( SvnVcs vcs, SVNRevision pegRevision, LogEntry logEntry, String url, String copyFromPath) { final SVNRevision revision = SVNRevision.create(logEntry.getRevision()); myRevisionNumber = new SvnRevisionNumber(revision); myPegRevision = pegRevision; myRevision = revision; myAuthor = logEntry.getAuthor(); myDate = logEntry.getDate(); myCommitMessage = logEntry.getMessage(); myCopyFromPath = copyFromPath; myVCS = vcs; myURL = url; myMergeSources = new ArrayList<>(); }
public void log(LogEntry entry) { NoExRun.wrap( () -> { String query = "insert into usage_log(action_date, username, method, user_action) values(?, ?, ?, ?);"; PreparedStatement stm = connection.getConnection().prepareStatement(query); stm.setTimestamp(1, new Timestamp(entry.getDate().getTime())); stm.setString(2, entry.getUsername()); stm.setString(3, entry.getMethod()); stm.setString(4, entry.getAction()); return stm.execute(); }) .get(); }
protected SvnFileRevision createRevision( final LogEntry logEntry, final String copyPath, LogEntryPath entryPath) throws SVNException { Date date = logEntry.getDate(); String author = logEntry.getAuthor(); String message = logEntry.getMessage(); SVNRevision rev = SVNRevision.create(logEntry.getRevision()); final SVNURL url = myRepositoryRoot.appendPath(myLastPath, true); // final SVNURL url = entryPath != null ? // myRepositoryRoot.appendPath(entryPath.getPath(), true) : // myRepositoryRoot.appendPath(myLastPathCorrector.getBefore(), // false); return new SvnFileRevision( myVcs, myPegRevision, rev, url.toString(), author, date, message, copyPath, myCharset); }