private String update(SvnOperationFactory svnOperationFactory, String label) throws SVNException { logger.debug("Repo already checked out - updating instead."); try { final SvnUpdate update = svnOperationFactory.createUpdate(); update.setSingleTarget(SvnTarget.fromFile(getWorkingDirectory())); long[] ids = update.run(); StringBuilder version = new StringBuilder(); for (long id : ids) { if (version.length() > 0) { version.append(","); } version.append(id); } return version.toString(); } catch (Exception e) { String message = "Could not update remote for " + label + " (current local=" + getWorkingDirectory().getPath() + "), remote: " + this.getUri() + ")"; if (logger.isDebugEnabled()) { logger.debug(message, e); } else if (logger.isWarnEnabled()) { logger.warn(message); } } final SVNStatus status = SVNClientManager.newInstance().getStatusClient() .doStatus(getWorkingDirectory(), false); return status != null ? status.getRevision().toString() : null; }
long elapsed = -System.currentTimeMillis(); if (logger.isDebugEnabled()) { logger.debug("(svn) current r" + status.getRevision().getNumber() + " svn update " + svnUrl + " into " + userDir);
long elapsed = -System.currentTimeMillis(); if (logger.isDebugEnabled()) { logger.debug("(svn) current r" + status.getRevision().getNumber() + " svn update " + svnUrl + " into " + userDir);
import org.tmatesoft.svn.core.wc.* buildscript { repositories { mavenCentral() } dependencies { classpath group: 'org.tmatesoft.svnkit', name: 'svnkit', version: '1.7.11' } } def getSvnRevision(){ ISVNOptions options = SVNWCUtil.createDefaultOptions(true); SVNClientManager clientManager = SVNClientManager.newInstance(options); SVNStatusClient statusClient = clientManager.getStatusClient(); SVNStatus status = statusClient.doStatus(projectDir, false); SVNRevision revision = status.getRevision(); return revision.getNumber(); } allprojects { version = '1.2.3.' + getSvnRevision() }
SVNClientManager clientManager = SVNClientManager.newInstance(options); SVNStatusClient statusClient = clientManager.getStatusClient(); SVNStatus status = statusClient.doStatus(projectDir, false); SVNRevision revision = status.getRevision(); return revision.getNumber();
public void handleStatus(SVNStatus status) { if (status.getEntryProperties() == null || status.getEntryProperties().isEmpty()) { return; } if (status.getContentsStatus() != SVNStatusType.STATUS_ADDED) { SVNRevision revision = status.getRevision(); if (revision != null) { if (minRevision[0] < 0 || minRevision[0] > revision.getNumber()) { minRevision[0] = revision.getNumber(); } maxRevision[0] = Math.max(maxRevision[0], revision.getNumber()); } } switched[0] |= status.isSwitched(); switched[1] |= status.getContentsStatus() != SVNStatusType.STATUS_NORMAL; switched[1] |= status.getPropertiesStatus() != SVNStatusType.STATUS_NORMAL && status.getPropertiesStatus() != SVNStatusType.STATUS_NONE; if (wcURL[0] == null && status.getFile() != null && status.getFile().equals(path) && status.getURL() != null) { wcURL[0] = status.getURL().toString(); } } });
public void handleStatus(SVNStatus status) { if (status.getEntryProperties() == null || status.getEntryProperties().isEmpty()) { return; } if (status.getContentsStatus() != SVNStatusType.STATUS_ADDED) { SVNRevision revision = committed ? status.getCommittedRevision() : status.getRevision(); if (revision != null) { if (minRevision[0] < 0 || minRevision[0] > revision.getNumber()) { minRevision[0] = revision.getNumber(); } maxRevision[0] = Math.max(maxRevision[0], revision.getNumber()); } } switched[0] |= status.isSwitched(); switched[1] |= status.getContentsStatus() != SVNStatusType.STATUS_NORMAL; switched[1] |= status.getPropertiesStatus() != SVNStatusType.STATUS_NORMAL && status.getPropertiesStatus() != SVNStatusType.STATUS_NONE; switched[2] |= status.getEntry() != null && status.getEntry().getDepth() != SVNDepth.INFINITY; if (wcURL[0] == null && status.getFile() != null && status.getFile().equals(path) && status.getURL() != null) { wcURL[0] = status.getURL().toString(); } } }, null);
public void handleStatus(SVNStatus status) { if (status.getEntryProperties() == null || status.getEntryProperties().isEmpty()) { return; } if (status.getContentsStatus() != SVNStatusType.STATUS_ADDED) { SVNRevision revision = committed ? status.getCommittedRevision() : status.getRevision(); if (revision != null) { if (minRevision[0] < 0 || minRevision[0] > revision.getNumber()) { minRevision[0] = revision.getNumber(); } maxRevision[0] = Math.max(maxRevision[0], revision.getNumber()); } } switched[0] |= status.isSwitched(); switched[1] |= status.getContentsStatus() != SVNStatusType.STATUS_NORMAL; switched[1] |= status.getPropertiesStatus() != SVNStatusType.STATUS_NORMAL && status.getPropertiesStatus() != SVNStatusType.STATUS_NONE; switched[2] |= status.getEntry() != null && status.getEntry().getDepth() != SVNDepth.INFINITY; if (wcURL[0] == null && status.getFile() != null && status.getFile().equals(path) && status.getURL() != null) { wcURL[0] = status.getURL().toString(); } } }, null);
public void handleStatus(SVNStatus status) { if (status.getEntryProperties() == null || status.getEntryProperties().isEmpty()) { return; } if (status.getContentsStatus() != SVNStatusType.STATUS_ADDED && !status.isFileExternal()) { SVNRevision revision = getOperation().isCommitted() ? status.getCommittedRevision() : status.getRevision(); if (revision != null) { if (minRevision[0] < 0 || minRevision[0] > revision.getNumber()) { minRevision[0] = revision.getNumber(); } maxRevision[0] = Math.max(maxRevision[0], revision.getNumber()); } } switched[0] |= status.isSwitched(); switched[1] |= status.getContentsStatus() != SVNStatusType.STATUS_NORMAL; switched[1] |= status.getPropertiesStatus() != SVNStatusType.STATUS_NORMAL && status.getPropertiesStatus() != SVNStatusType.STATUS_NONE; switched[2] |= status.getEntry() != null && status.getEntry().getDepth() != SVNDepth.INFINITY; if (wcURL[0] == null && status.getFile() != null && status.getFile().equals(getFirstTarget()) && status.getURL() != null) { wcURL[0] = status.getURL().toString(); } } }, null);
nodeKind = NodeKind.unknown; long revision = status.getRevision().getNumber(); long lastChangedRevision = -1; if(status.getCommittedRevision() != null){
xmlMap.put("revision", status.getRevision().toString());
xmlMap.put("revision", status.getRevision().toString());
nodeKind = NodeKind.unknown; long revision = status.getRevision().getNumber(); long lastChangedRevision = -1; if(status.getCommittedRevision() != null){
nodeKind = NodeKind.unknown; long revision = status.getRevision().getNumber(); long lastChangedRevision = -1; if(status.getCommittedRevision() != null){
nodeKind = NodeKind.unknown; long revision = status.getRevision().getNumber(); long lastChangedRevision = -1; if(status.getCommittedRevision() != null){
addAttribute(SWITCHED_ATTR, TRUE); if (!status.isCopied() && status.getRevision() != null && status.getRevision().getNumber() >= 0) { addAttribute(REVISION_ATTR, status.getRevision().toString());
addAttribute(SWITCHED_ATTR, TRUE); if (!status.isCopied() && status.getRevision() != null && status.getRevision().getNumber() >= 0) { addAttribute(REVISION_ATTR, status.getRevision().toString());
addAttribute(SWITCHED_ATTR, TRUE); if (!status.isCopied() && status.getRevision() != null && status.getRevision().getNumber() >= 0) { addAttribute(REVISION_ATTR, status.getRevision().toString());
addAttribute(SWITCHED_ATTR, TRUE); if (!status.isCopied() && status.getRevision() != null && status.getRevision().getNumber() >= 0) { addAttribute(REVISION_ATTR, status.getRevision().toString());
result.setRepositoryUuid(status.getRepositoryUUID()); result.setRevision(revisionNumber(status.getRevision())); result.setSwitched(status.isSwitched()); result.setVersioned(status.isVersioned());