예제 #1
0
  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);
  }
 /**
  * Checks if the given list of strings occur in the given order among the given log messages (one
  * string per message).
  *
  * @param entries The list of log entries.
  * @param expected The array of expected strings.
  * @return true if a match was found for all expected strings, otherwise false.
  */
 private boolean containsExpectedEntries(ImmutableList<LogEntry> entries, String[] expected) {
   int index = 0;
   for (LogEntry entry : entries) {
     if (index == expected.length) {
       return true;
     }
     if (!entry.getMessage().contains(expected[index])) {
       index++;
     }
   }
   return (index == expected.length);
 }
 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<>();
 }
예제 #4
0
 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);
 }