private static long getLongDate(Date date) { SVNDate svnDate = SVNDate.fromDate(date); return svnDate.getTimeInMicros(); }
public static SVNSqlJetStatement bindf(SVNSqlJetStatement stmt, String format, Object... binds) throws SVNException { if (binds != null) { for (int i = 0; i < binds.length; i++) { if (binds[i] instanceof SVNWCDbStatus) { binds[i] = getPresenceText((SVNWCDbStatus) binds[i]); } else if (binds[i] instanceof SVNWCDbKind) { binds[i] = getKindText((SVNWCDbKind) binds[i]); } else if (binds[i] instanceof File) { binds[i] = SVNFileUtil.getFilePath((File) binds[i]); } else if (binds[i] instanceof SVNDate) { binds[i] = ((SVNDate) binds[i]).getTimeInMicros(); } else if (binds[i] instanceof SVNDepth) { binds[i] = binds[i].toString(); } } } stmt.bindf(format, binds); return stmt; }
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()); }
public SVNSkel wqBuildRecordFileinfo(File localAbspath, SVNDate setTime) throws SVNException { assert (SVNFileUtil.isAbsolute(localAbspath)); SVNSkel workItem = SVNSkel.createEmptyList(); if (setTime != null) { workItem.prependString(String.format("%d", setTime.getTimeInMicros())); } workItem.prependPath(getRelativePath(localAbspath)); workItem.prependString(WorkQueueOperation.RECORD_FILEINFO.getOpName()); SVNSkel result = SVNSkel.createEmptyList(); result.appendChild(workItem); return result; }
bindLong(i + 1, ((Number) data[n]).longValue()); } else if (data[n] instanceof SVNDate) { bindLong(i + 1, ((SVNDate) data[n]).getTimeInMicros()); } else { SVNErrorManager.assertionFailure(false, String.format("Number argument required in %d", i + 1), SVNLogType.WC);
public void runOperation(SVNWCContext ctx, File wcRootAbspath, SVNSkel workItem) throws NumberFormatException, SVNException { File localAbspath = SVNFileUtil.createFilePath(wcRootAbspath, workItem.getChild(1).getValue()); SVNDate setTime = null; if (workItem.getListSize() > 2) { long val = Long.parseLong(workItem.getChild(2).getValue()); setTime = SVNWCUtils.readDate(val); } if (setTime != null) { if (SVNFileType.getType(localAbspath).isFile()) { SVNFileUtil.setFileLastModifiedMicros(localAbspath, setTime.getTimeInMicros()); } } ctx.getAndRecordFileInfo(localAbspath, true); } }
final SVNDate changedDate = installInfo.get(InstallInfo.changedDate); if (changedDate != null) { SVNFileUtil.setFileLastModifiedMicros(localAbspath, changedDate.getTimeInMicros());