public void removeNotLastModifications() { List<String> uniquePaths = getUniquePaths(); for (String path : uniquePaths) { int lastRevision = getLastModificationRevisionForPath(path); int count = logEntries.size(); int i = 0; while (i < count) { LogEntry entry = logEntries.get(i); if (entry.getRevision() < lastRevision) { entry.removeEntriesWithPath(path); if (entry.isEmpty()) { logEntries.remove(entry); count--; i--; } } i++; } } isOrdered = false; }
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 LogEntry getLogEntryByRevision(int revision) { for (LogEntry logEntry : logEntries) { if (logEntry.getRevision() == revision) { return logEntry; } } return null; }
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<>(); }
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); }
public boolean isExpectedPathEntryExists(MergeExpectedPathEntry expectedEntry) { if (expectedEntry == null) { return false; } for (LogEntry logEntry : logEntries) { if (logEntry.getRevision() < expectedEntry.getAllowedRevision()) { continue; } if (expectedEntry.isExpectedPathEntryExists(logEntry.getPathEntries())) { return true; } } return false; }
public void union(LogReport report) { if (report == null) { return; } List<LogEntry> logEntries = report.getOrderedLogEntries(); for (LogEntry logEntry : logEntries) { LogEntry _logEntry = getLogEntryByRevision(logEntry.getRevision()); if (_logEntry == null) { this.addLogEntry(logEntry); continue; } _logEntry.union(logEntry); } isOrdered = false; }
public boolean hasSamePathEntryWithHigherRevisionForAuthor(PathEntry pathEntry, String author) { for (LogEntry logEntry : logEntries) { if (!logEntry.getAuthor().equals(author) || logEntry.getRevision() < pathEntry.getRevision()) { continue; } List<PathEntry> pathEntries = logEntry.getPathEntries(); for (PathEntry _pathEntry : pathEntries) { if (_pathEntry.getPath().equals(pathEntry.getPath()) && _pathEntry.getAction().equals(pathEntry.getAction())) { return true; } } } return false; }
public void removeLogEntriesWithRevisionLowerThan(int revision) { List<LogEntry> logEntries = getOrderedLogEntries(); if (logEntries.isEmpty()) { return; } int count = this.logEntries.size(); int i = 0; while (i < count) { LogEntry entry = this.logEntries.get(i); if (entry.getRevision() < revision) { this.logEntries.remove(entry); count--; continue; } i++; } isOrdered = false; }