/** * Gets the last modified time for the given revision. * * @param revision revision to get the last modified date for * * @return the last modified time * * @throws ResourceException thrown if there is a problem getting the last modified time */ private DateTime getLastModificationForRevision(SVNRevision revision) throws ResourceException { try { SVNStatusHandler handler = new SVNStatusHandler(); clientManager.getStatusClient().doStatus(getResourceFile(), revision, SVNDepth.INFINITY, true, true, false, false, handler, null); SVNStatus status = handler.getStatus(); // remote revision is null when using a pegged version or when using HEAD and the version has not changed if (status.getRemoteRevision() == null) { return new DateTime(status.getCommittedDate()); } else { return new DateTime(status.getRemoteDate()); } } catch (SVNException e) { String errMsg = "Unable to check status of resource " + resourceFileName + " within working directory " + workingCopyDirectory.getAbsolutePath(); log.error(errMsg, e); throw new ResourceException(errMsg, e); } }
/** * Gets the repository revision just committed. */ public long revision() throws Exception { // .getLookClient().doGetYoungestRevision(repo) would show last committed revision but would not be sensitive to checked-out branch; which is clearer? return SVNClientManager.newInstance().getStatusClient().doStatus(wc, true).getRemoteRevision().getNumber(); // http://stackoverflow.com/a/2295674/12916 }
long reposRev = (status.getRemoteRevision() != null && status.getRemoteRevision() != SVNRevision.UNDEFINED) ? status.getRemoteRevision().getNumber() : -1; long reposDate = status.getRemoteDate() != null ? status.getRemoteDate().getTime() * 1000 : -1; String reposAuthor = status.getRemoteAuthor();
long reposRev = status.getRemoteRevision() != null ? status.getRemoteRevision().getNumber() : -1; long reposDate = status.getRemoteDate() != null ? status.getRemoteDate().getTime() * 1000 : -1; String reposAuthor = status.getRemoteAuthor();
long reposRev = status.getRemoteRevision() != null ? status.getRemoteRevision().getNumber() : -1; long reposDate = status.getRemoteDate() != null ? status.getRemoteDate().getTime() * 1000 : -1; String reposAuthor = status.getRemoteAuthor();
long reposRev = status.getRemoteRevision() != null ? status.getRemoteRevision().getNumber() : -1; long reposDate = status.getRemoteDate() != null ? status.getRemoteDate().getTime() * 1000 : -1; String reposAuthor = status.getRemoteAuthor();
long reposRev = status.getRemoteRevision() != null ? status.getRemoteRevision().getNumber() : -1; long reposDate = status.getRemoteDate() != null ? status.getRemoteDate().getTime() * 1000 : -1; String reposAuthor = status.getRemoteAuthor();
result.setRepositoryChangedRevision(revisionNumber(status.getRemoteRevision())); result.setRepositoryKind(status.getRemoteKind()); result.setRepositoryLock(status.getRemoteLock());