public String getTextTime() { return textTime != null ? textTime.format() : null; }
myBuffer = openXMLTag("commit", SVNXMLUtil.XML_STYLE_NORMAL, "revision", Long.toString(revision), myBuffer); myBuffer = openCDataTag("author", author, myBuffer); myBuffer = openCDataTag("date", ((SVNDate) date).format(), myBuffer); myBuffer = closeXMLTag("commit", myBuffer); Long.toString(mergedRevision), myBuffer); myBuffer = openCDataTag("author", mergedAuthor, myBuffer); myBuffer = openCDataTag("date", ((SVNDate) mergedDate).format(), myBuffer); myBuffer = closeXMLTag("commit", myBuffer); myBuffer = closeXMLTag("merged", myBuffer);
public String getLockCreationDate() { return lockCreationDate != null ? lockCreationDate.format() : null; }
public String getCommittedDate() { return committedDate != null ? committedDate.format() : null; }
public String getPropTime() { return propTime != null ? propTime.format() : null; }
public static String formatDate(Date date, boolean formatZeroDate) { if (date == null) { return null; } else if (!formatZeroDate && date.getTime() == 0) { return null; } if (date instanceof SVNDate) { SVNDate extendedDate = (SVNDate) date; return extendedDate.format(); } synchronized (ISO8601_FORMAT) { return ISO8601_FORMAT.format(date); } }
public static String formatDate(Date date, boolean formatZeroDate) { if (date == null) { return null; } else if (!formatZeroDate && date.getTime() == 0) { return null; } if (date instanceof SVNDate) { SVNDate extendedDate = (SVNDate) date; return extendedDate.format(); } synchronized (ISO8601_FORMAT) { return ISO8601_FORMAT.format(date); } }
public static String formatDate(Date date, boolean formatZeroDate) { if (date == null) { return null; } else if (!formatZeroDate && date.getTime() == 0) { return null; } if (date instanceof SVNDate) { SVNDate extendedDate = (SVNDate) date; return extendedDate.format(); } synchronized (ISO8601_FORMAT) { return ISO8601_FORMAT.format(date); } }
private SVNProperties createRevisionProperties(String author, Date date) { if (author == null && date == null) { return null; } SVNProperties properties = new SVNProperties(); if (author != null) { properties.put(SVNRevisionProperty.AUTHOR, author); } if (date != null) { properties.put(SVNRevisionProperty.DATE, SVNDate.fromDate(date).format()); } return properties; }
private void writeRevisionRecord(OutputStream dumpStream, FSFS fsfs, long revision) throws SVNException { SVNProperties revProps = fsfs.getRevisionProperties(revision); String revisionDate = revProps.getStringValue(SVNRevisionProperty.DATE); if (revisionDate != null) { SVNDate date = SVNDate.parseDate(revisionDate); revProps.put(SVNRevisionProperty.DATE, date.format()); } ByteArrayOutputStream encodedProps = new ByteArrayOutputStream(); SVNAdminHelper.writeProperties(revProps, null, encodedProps); writeDumpData(dumpStream, SVNAdminHelper.DUMPFILE_REVISION_NUMBER + ": " + revision + "\n"); String propContents = null; try { propContents = new String(encodedProps.toByteArray(), "UTF-8"); } catch (UnsupportedEncodingException uee) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, uee.getLocalizedMessage()); SVNErrorManager.error(err, uee, SVNLogType.FSFS); } writeDumpData(dumpStream, SVNAdminHelper.DUMPFILE_PROP_CONTENT_LENGTH + ": " + propContents.length() + "\n"); writeDumpData(dumpStream, SVNAdminHelper.DUMPFILE_CONTENT_LENGTH + ": " + propContents.length() + "\n\n"); writeDumpData(dumpStream, propContents); writeDumpData(dumpStream, "\n"); }
private void writeRevisionRecord(OutputStream dumpStream, FSFS fsfs, long revision) throws SVNException { SVNProperties revProps = fsfs.getRevisionProperties(revision); String revisionDate = revProps.getStringValue(SVNRevisionProperty.DATE); if (revisionDate != null) { SVNDate date = SVNDate.parseDate(revisionDate); revProps.put(SVNRevisionProperty.DATE, date.format()); } ByteArrayOutputStream encodedProps = new ByteArrayOutputStream(); SVNAdminHelper.writeProperties(revProps, null, encodedProps); writeDumpData(dumpStream, SVNAdminHelper.DUMPFILE_REVISION_NUMBER + ": " + revision + "\n"); String propContents = null; try { propContents = new String(encodedProps.toByteArray(), "UTF-8"); } catch (UnsupportedEncodingException uee) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, uee.getLocalizedMessage()); SVNErrorManager.error(err, uee, SVNLogType.FSFS); } writeDumpData(dumpStream, SVNAdminHelper.DUMPFILE_PROP_CONTENT_LENGTH + ": " + propContents.length() + "\n"); writeDumpData(dumpStream, SVNAdminHelper.DUMPFILE_CONTENT_LENGTH + ": " + propContents.length() + "\n\n"); writeDumpData(dumpStream, propContents); writeDumpData(dumpStream, "\n"); }
private void writeRevisionRecord(OutputStream dumpStream, FSFS fsfs, long revision) throws SVNException { SVNProperties revProps = fsfs.getRevisionProperties(revision); String revisionDate = revProps.getStringValue(SVNRevisionProperty.DATE); if (revisionDate != null) { SVNDate date = SVNDate.parseDate(revisionDate); revProps.put(SVNRevisionProperty.DATE, date.format()); } ByteArrayOutputStream encodedProps = new ByteArrayOutputStream(); SVNAdminHelper.writeProperties(revProps, null, encodedProps); writeDumpData(dumpStream, SVNAdminHelper.DUMPFILE_REVISION_NUMBER + ": " + revision + "\n"); String propContents = null; try { propContents = new String(encodedProps.toByteArray(), "UTF-8"); } catch (UnsupportedEncodingException uee) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, uee.getLocalizedMessage()); SVNErrorManager.error(err, uee, SVNLogType.FSFS); } writeDumpData(dumpStream, SVNAdminHelper.DUMPFILE_PROP_CONTENT_LENGTH + ": " + propContents.length() + "\n"); writeDumpData(dumpStream, SVNAdminHelper.DUMPFILE_CONTENT_LENGTH + ": " + propContents.length() + "\n\n"); writeDumpData(dumpStream, propContents); writeDumpData(dumpStream, "\n"); }
public void logTweakEntry(String name, String newURL, long newRevision) throws SVNException { SVNProperties attributes = new SVNProperties(); attributes.put(SVNProperty.shortPropertyName(SVNProperty.KIND), SVNProperty.KIND_FILE); attributes.put(SVNProperty.shortPropertyName(SVNProperty.REVISION), Long.toString(newRevision)); attributes.put(SVNProperty.shortPropertyName(SVNProperty.DELETED), Boolean.FALSE.toString()); attributes.put(SVNProperty.shortPropertyName(SVNProperty.ABSENT), Boolean.FALSE.toString()); attributes.put(SVNProperty.shortPropertyName(SVNProperty.WORKING_SIZE), Long.toString(SVNProperty.WORKING_SIZE_UNKNOWN)); attributes.put(SVNProperty.shortPropertyName(SVNProperty.TEXT_TIME), SVNDate.NULL.format()); if (newURL != null) { attributes.put(SVNProperty.shortPropertyName(SVNProperty.URL), newURL); } logChangedEntryProperties(name, attributes); }
public void logTweakEntry(String name, String newURL, long newRevision) throws SVNException { SVNProperties attributes = new SVNProperties(); attributes.put(SVNProperty.shortPropertyName(SVNProperty.KIND), SVNProperty.KIND_FILE); attributes.put(SVNProperty.shortPropertyName(SVNProperty.REVISION), Long.toString(newRevision)); attributes.put(SVNProperty.shortPropertyName(SVNProperty.DELETED), Boolean.FALSE.toString()); attributes.put(SVNProperty.shortPropertyName(SVNProperty.ABSENT), Boolean.FALSE.toString()); attributes.put(SVNProperty.shortPropertyName(SVNProperty.WORKING_SIZE), Long.toString(SVNProperty.WORKING_SIZE_UNKNOWN)); attributes.put(SVNProperty.shortPropertyName(SVNProperty.TEXT_TIME), SVNDate.NULL.format()); if (newURL != null) { attributes.put(SVNProperty.shortPropertyName(SVNProperty.URL), newURL); } logChangedEntryProperties(name, attributes); }
public void logTweakEntry(String name, String newURL, long newRevision) throws SVNException { SVNProperties attributes = new SVNProperties(); attributes.put(SVNProperty.shortPropertyName(SVNProperty.KIND), SVNProperty.KIND_FILE); attributes.put(SVNProperty.shortPropertyName(SVNProperty.REVISION), Long.toString(newRevision)); attributes.put(SVNProperty.shortPropertyName(SVNProperty.DELETED), Boolean.FALSE.toString()); attributes.put(SVNProperty.shortPropertyName(SVNProperty.ABSENT), Boolean.FALSE.toString()); attributes.put(SVNProperty.shortPropertyName(SVNProperty.WORKING_SIZE), Long.toString(SVNProperty.WORKING_SIZE_UNKNOWN)); attributes.put(SVNProperty.shortPropertyName(SVNProperty.TEXT_TIME), SVNDate.NULL.format()); if (newURL != null) { attributes.put(SVNProperty.shortPropertyName(SVNProperty.URL), newURL); } logChangedEntryProperties(name, attributes); }
public Map<String, byte[]> getKeyWords(File localAbsPath, String forceList) throws SVNException { assert (isAbsolute(localAbsPath)); String list; /* * Choose a property list to parse: either the one that came into this * function, or the one attached to PATH. */ if (forceList == null) { list = getProperty(localAbsPath, SVNProperty.KEYWORDS); /* The easy answer. */ if (list == null) { return null; } } else list = forceList; final SVNURL url = getNodeUrl(localAbsPath); final WCDbInfo readInfo = db.readInfo(localAbsPath, InfoField.changedRev, InfoField.changedDate, InfoField.changedAuthor, InfoField.reposRootUrl); return SVNTranslator.computeKeywords(list, url.toString(), readInfo.reposRootUrl == null ? null: readInfo.reposRootUrl.toString(), readInfo.changedAuthor, readInfo.changedDate != null ? readInfo.changedDate.format() : null, Long.toString(readInfo.changedRev), getOptions()); }
private static void obtainEolAndKeywordsForFile(Map<String, byte[]> keywords, SVNWCContext.SVNEolStyle[] eolStyle, String[] eolStr, SVNWCContext context, File localAbsPath) throws SVNException { final SVNProperties actualProps = context.getActualProps(localAbsPath); SVNPropertyValue keywordsVal = actualProps.getSVNPropertyValue(SVNProperty.KEYWORDS); if (keywordsVal != null) { ISVNWCDb.WCDbInfo nodeChangedInfo = context.getNodeChangedInfo(localAbsPath); long changedRev = nodeChangedInfo.changedRev; SVNDate changedDate = nodeChangedInfo.changedDate; String changedAuthor = nodeChangedInfo.changedAuthor; SVNURL url = context.getNodeUrl(localAbsPath); SVNWCContext.SVNWCNodeReposInfo nodeReposInfo = context.getNodeReposInfo(localAbsPath); SVNURL reposRootUrl = nodeReposInfo.reposRootUrl; if (keywords != null) { keywords.putAll(SVNTranslator.computeKeywords(SVNPropertyValue.getPropertyAsString(keywordsVal), url == null ? null : url.toString(), reposRootUrl == null ? null : reposRootUrl.toString(), changedAuthor, changedDate.format(), String.valueOf(changedRev), null)); } } SVNPropertyValue eolStyleVal = actualProps.getSVNPropertyValue(SVNProperty.EOL_STYLE); if (eolStyleVal != null) { String eolStyleValString = SVNPropertyValue.getPropertyAsString(eolStyleVal); SVNWCContext.SVNEolStyleInfo eolStyleInfo = SVNWCContext.SVNEolStyleInfo.fromValue(eolStyleValString); if (eolStr != null) { eolStr[0] = new String(eolStyleInfo.eolStr); } if (eolStyle != null) { eolStyle[0] = eolStyleInfo.eolStyle; } } }
private Map<String, byte[]> expandKeywords(File localAbsPath, File wriAbspath, String keywordsList, boolean forNormalization) throws SVNException { String url = null; String repositoryRoot = null; SVNDate changedDate = null; long changedRev; String changedAuthor = null; if (!forNormalization) { WCDbInfo info = getDb().readInfo(localAbsPath, InfoField.reposRelPath, InfoField.reposRootUrl, InfoField.changedRev, InfoField.changedAuthor, InfoField.changedDate); changedAuthor = info.changedAuthor; changedRev = info.changedRev; changedDate = info.changedDate; repositoryRoot = info.reposRootUrl == null ? null : info.reposRootUrl.toString(); if (info.reposRelPath != null) { url = info.reposRootUrl.appendPath(SVNFileUtil.getFilePath(info.reposRelPath), false).toString(); } else { SVNURL svnUrl = getNodeUrl(localAbsPath); if (svnUrl != null) { url = svnUrl.toString(); } } } else { url = ""; repositoryRoot = null; changedRev = INVALID_REVNUM; changedDate = SVNDate.NULL; changedAuthor = ""; } return SVNTranslator.computeKeywords(keywordsList, url, repositoryRoot, changedAuthor, changedDate != null ? changedDate.format() : null, Long.toString(changedRev), getOptions()); }
buffer = openCDataTag("author", dirEntry.getAuthor(), buffer); if (dirEntry.getDate() != null) { buffer = openCDataTag("date", ((SVNDate) dirEntry.getDate()).format(), buffer); buffer = openCDataTag("owner", lock.getOwner(), buffer); buffer = openCDataTag("comment", lock.getComment(), buffer); buffer = openCDataTag("created", ((SVNDate) lock.getCreationDate()).format(), buffer); if (lock.getExpirationDate() != null && lock.getExpirationDate().getTime() > 0) { buffer = openCDataTag("expires", ((SVNDate) lock.getExpirationDate()).format(), buffer);
buffer = openCDataTag("author", dirEntry.getAuthor(), buffer); if (dirEntry.getDate() != null) { buffer = openCDataTag("date", ((SVNDate) dirEntry.getDate()).format(), buffer); buffer = openCDataTag("owner", lock.getOwner(), buffer); buffer = openCDataTag("comment", lock.getComment(), buffer); buffer = openCDataTag("created", ((SVNDate) lock.getCreationDate()).format(), buffer); if (lock.getExpirationDate() != null && lock.getExpirationDate().getTime() > 0) { buffer = openCDataTag("expires", ((SVNDate) lock.getExpirationDate()).format(), buffer);