public void singleMessage(ChangePath[] changedPaths, long revision, Map revprops, boolean hasChildren) { String author = (String) revprops.get("svn:author"); String message = (String) revprops.get("svn:log"); long timeMicros; try { LogDate date = new LogDate((String) revprops.get("svn:date")); timeMicros = date.getTimeMicros(); } catch (ParseException ex) { timeMicros = 0; } LogMessage msg = new LogMessage(changedPaths, revision, author, timeMicros, message); /* Filter out the SVN_INVALID_REVNUM message which pre-1.5 clients won't expect, nor understand. */ if (revision != Revision.SVN_INVALID_REVNUM) messages.add(msg); }
null, false, true); assertEquals("wrong number of objects", 1, lm.length); assertEquals("wrong message", "Log Message", lm[0].getMessage()); assertEquals("wrong revision", 1, lm[0].getRevisionNumber()); assertEquals("wrong user", "jrandom", lm[0].getAuthor()); assertNotNull("changed paths set", lm[0].getChangedPaths()); ChangePath cp[] = lm[0].getChangedPaths(); assertEquals("wrong number of chang pathes", 20, cp.length); assertEquals("wrong path", "/A", cp[0].getPath()); assertEquals("wrong action", 'A', cp[0].getAction()); assertEquals("wrong time with getTimeMicros()", lm[0].getTimeMicros()/1000, lm[0].getDate().getTime()); assertEquals("wrong time with getTimeMillis()", lm[0].getTimeMillis(), lm[0].getDate().getTime()); assertEquals("wrong date with getTimeMicros()", lm[0].getDate(), new java.util.Date(lm[0].getTimeMicros()/1000)); assertEquals("wrong date with getTimeMillis()", lm[0].getDate(), new java.util.Date(lm[0].getTimeMillis()));
null, false, true); assertEquals("wrong number of objects", 1, lm.length); assertEquals("wrong message", "Log Message", lm[0].getMessage()); assertEquals("wrong revision", 1, lm[0].getRevisionNumber()); assertEquals("wrong user", "jrandom", lm[0].getAuthor()); assertNotNull("changed paths set", lm[0].getChangedPaths()); ChangePath cp[] = lm[0].getChangedPaths(); assertEquals("wrong number of chang pathes", 20, cp.length); assertEquals("wrong path", "/A", cp[0].getPath()); assertEquals("wrong action", 'A', cp[0].getAction()); assertEquals("wrong time with getTimeMicros()", lm[0].getTimeMicros()/1000, lm[0].getDate().getTime()); assertEquals("wrong time with getTimeMillis()", lm[0].getTimeMillis(), lm[0].getDate().getTime()); assertEquals("wrong date with getTimeMicros()", lm[0].getDate(), new java.util.Date(lm[0].getTimeMicros()/1000)); assertEquals("wrong date with getTimeMillis()", lm[0].getDate(), new java.util.Date(lm[0].getTimeMillis()));
public void singleMessage(ChangePath[] changedPaths, long revision, Map revprops, boolean hasChildren) { String author = (String) revprops.get("svn:author"); String message = (String) revprops.get("svn:log"); long timeMicros; try { LogDate date = new LogDate((String) revprops.get("svn:date")); timeMicros = date.getTimeMicros(); } catch (ParseException ex) { timeMicros = 0; } LogMessage msg = new LogMessage(changedPaths, revision, author, timeMicros, message); /* Filter out the SVN_INVALID_REVNUM message which pre-1.5 clients won't expect, nor understand. */ if (revision != Revision.SVN_INVALID_REVNUM) messages.add(msg); }
public static LogMessage createLogMessage(SVNLogEntry logEntry) { if(logEntry == null){ return null; } Map cpaths = logEntry.getChangedPaths(); ChangePath[] cp = null; if(cpaths == null){ cp = new ChangePath[]{}; }else{ Collection clientChangePaths = new ArrayList(); for (Iterator iter = cpaths.keySet().iterator(); iter.hasNext();) { String path = (String) iter.next(); SVNLogEntryPath entryPath = (SVNLogEntryPath)cpaths.get(path); if(entryPath != null){ clientChangePaths.add(new ChangePath(path, entryPath.getCopyRevision(), entryPath.getCopyPath(), entryPath.getType())); } } cp = (ChangePath[]) clientChangePaths.toArray(new ChangePath[clientChangePaths.size()]); } return new LogMessage(logEntry.getMessage(), logEntry.getDate(), logEntry.getRevision(), logEntry.getAuthor(), cp); }
public static LogMessage createLogMessage(SVNLogEntry logEntry) { if(logEntry == null){ return null; } Map cpaths = logEntry.getChangedPaths(); ChangePath[] cp = null; if(cpaths == null){ cp = new ChangePath[]{}; }else{ Collection clientChangePaths = new ArrayList(); for (Iterator iter = cpaths.keySet().iterator(); iter.hasNext();) { String path = (String) iter.next(); SVNLogEntryPath entryPath = (SVNLogEntryPath)cpaths.get(path); if(entryPath != null){ clientChangePaths.add(new ChangePath(path, entryPath.getCopyRevision(), entryPath.getCopyPath(), entryPath.getType(), getNodeKind(entryPath.getKind()))); } } cp = (ChangePath[]) clientChangePaths.toArray(new ChangePath[clientChangePaths.size()]); // sort by paths. Arrays.sort(cp, CHANGE_PATH_COMPARATOR); } long time = 0; if (logEntry.getDate() != null) { time = logEntry.getDate().getTime()*1000; if (logEntry.getDate() instanceof SVNDate) { time = ((SVNDate) logEntry.getDate()).getTimeInMicros(); } } return new LogMessage(cp, logEntry.getRevision(), logEntry.getAuthor(), time, logEntry.getMessage()); }
public static LogMessage createLogMessage(SVNLogEntry logEntry) { if(logEntry == null){ return null; } Map cpaths = logEntry.getChangedPaths(); ChangePath[] cp = null; if(cpaths == null){ cp = new ChangePath[]{}; }else{ Collection clientChangePaths = new ArrayList(); for (Iterator iter = cpaths.keySet().iterator(); iter.hasNext();) { String path = (String) iter.next(); SVNLogEntryPath entryPath = (SVNLogEntryPath)cpaths.get(path); if(entryPath != null){ clientChangePaths.add(new ChangePath(path, entryPath.getCopyRevision(), entryPath.getCopyPath(), entryPath.getType(), getNodeKind(entryPath.getKind()))); } } cp = (ChangePath[]) clientChangePaths.toArray(new ChangePath[clientChangePaths.size()]); // sort by paths. Arrays.sort(cp, CHANGE_PATH_COMPARATOR); } long time = 0; if (logEntry.getDate() != null) { time = logEntry.getDate().getTime()*1000; if (logEntry.getDate() instanceof SVNDate) { time = ((SVNDate) logEntry.getDate()).getTimeInMicros(); } } return new LogMessage(cp, logEntry.getRevision(), logEntry.getAuthor(), time, logEntry.getMessage()); }
public static LogMessage createLogMessage(SVNLogEntry logEntry) { if(logEntry == null){ return null; } Map cpaths = logEntry.getChangedPaths(); ChangePath[] cp = null; if(cpaths == null){ cp = new ChangePath[]{}; }else{ Collection clientChangePaths = new ArrayList(); for (Iterator iter = cpaths.keySet().iterator(); iter.hasNext();) { String path = (String) iter.next(); SVNLogEntryPath entryPath = (SVNLogEntryPath)cpaths.get(path); if(entryPath != null){ clientChangePaths.add(new ChangePath(path, entryPath.getCopyRevision(), entryPath.getCopyPath(), entryPath.getType(), getNodeKind(entryPath.getKind()))); } } cp = (ChangePath[]) clientChangePaths.toArray(new ChangePath[clientChangePaths.size()]); // sort by paths. Arrays.sort(cp, CHANGE_PATH_COMPARATOR); } long time = 0; if (logEntry.getDate() != null) { time = logEntry.getDate().getTime()*1000; if (logEntry.getDate() instanceof SVNDate) { time = ((SVNDate) logEntry.getDate()).getTimeInMicros(); } } return new LogMessage(cp, logEntry.getRevision(), logEntry.getAuthor(), time, logEntry.getMessage()); }
public static LogMessage createLogMessage(SVNLogEntry logEntry) { if(logEntry == null){ return null; } Map cpaths = logEntry.getChangedPaths(); ChangePath[] cp = null; if(cpaths == null){ cp = new ChangePath[]{}; }else{ Collection clientChangePaths = new ArrayList(); for (Iterator iter = cpaths.keySet().iterator(); iter.hasNext();) { String path = (String) iter.next(); SVNLogEntryPath entryPath = (SVNLogEntryPath)cpaths.get(path); if(entryPath != null){ clientChangePaths.add(new ChangePath(path, entryPath.getCopyRevision(), entryPath.getCopyPath(), entryPath.getType(), getNodeKind(entryPath.getKind()))); } } cp = (ChangePath[]) clientChangePaths.toArray(new ChangePath[clientChangePaths.size()]); // sort by paths. Arrays.sort(cp, CHANGE_PATH_COMPARATOR); } long time = 0; if (logEntry.getDate() != null) { time = logEntry.getDate().getTime()*1000; if (logEntry.getDate() instanceof SVNDate) { time = ((SVNDate) logEntry.getDate()).getTimeInMicros(); } } return new LogMessage(cp, logEntry.getRevision(), logEntry.getAuthor(), time, logEntry.getMessage()); }