if (SVNProperty.SCHEDULE_ADD.equals(info.getSchedule())) { schedule = ScheduleKind.add; } else if (SVNProperty.SCHEDULE_DELETE.equals(info.getSchedule())) { schedule = ScheduleKind.delete; long copyRev = info.getCopyFromRevision() != null ? info.getCopyFromRevision().getNumber() : -1; String copyUrl = info.getCopyFromURL() != null ? info.getCopyFromURL().toString() : null; String path = info.getFile() != null ? info.getFile().getAbsolutePath() : info.getPath(); if (path != null) { path = path.replace(File.separatorChar, '/'); int depth = info.getDepth() != null ? info.getDepth().getId() : Depth.unknown; if (info.getKind() == SVNNodeKind.FILE) { depth = 0; info.getURL() != null ? info.getURL().toString() : null, info.getRevision() != null ? info.getRevision().getNumber() : -1, getNodeKind(info.getKind()), info.getRepositoryRootURL() != null ? info.getRepositoryRootURL().toString() : null, info.getRepositoryUUID(), info.getCommittedRevision() != null ? info.getCommittedRevision().getNumber() : - 1, info.getCommittedDate() != null ? info.getCommittedDate().getTime() * 1000 : 0, info.getAuthor(), createLock(info.getLock()), !info.isRemote(), schedule, copyUrl, copyRev, info.getTextTime() != null ? info.getTextTime().getTime() * 1000 : 0, info.getPropTime() != null ? info.getPropTime().getTime() * 1000 : 0,
if (SVNProperty.SCHEDULE_ADD.equals(info.getSchedule())) { schedule = ScheduleKind.add; } else if (SVNProperty.SCHEDULE_DELETE.equals(info.getSchedule())) { schedule = ScheduleKind.delete; long copyRev = info.getCopyFromRevision() != null ? info.getCopyFromRevision().getNumber() : -1; String copyUrl = info.getCopyFromURL() != null ? info.getCopyFromURL().toString() : null; String path = info.getFile() != null ? info.getFile().getAbsolutePath() : info.getPath(); if (path != null) { path = path.replace(File.separatorChar, '/'); info.getURL() != null ? info.getURL().toString() : null, info.getRevision() != null ? info.getRevision().getNumber() : -1, getNodeKind(info.getKind()), info.getRepositoryRootURL() != null ? info.getRepositoryRootURL().toString() : null, info.getRepositoryUUID(), info.getCommittedRevision() != null ? info.getCommittedRevision().getNumber() : - 1, info.getCommittedDate() != null ? info.getCommittedDate().getTime() * 1000 : 0, info.getAuthor(), createLock(info.getLock()), !info.isRemote(), schedule, copyUrl, copyRev, info.getTextTime() != null ? info.getTextTime().getTime() * 1000 : 0, info.getPropTime() != null ? info.getPropTime().getTime() * 1000 : 0, info.getChecksum(), info.getConflictOldFile() != null ? info.getConflictOldFile().getName() : null, info.getConflictNewFile() != null ? info.getConflictNewFile().getName() : null, info.getConflictWrkFile() != null ? info.getConflictWrkFile().getName() : null,
if (SVNProperty.SCHEDULE_ADD.equals(info.getSchedule())) { schedule = ScheduleKind.add; } else if (SVNProperty.SCHEDULE_DELETE.equals(info.getSchedule())) { schedule = ScheduleKind.delete; File file = info.getFile(); long copyRev = info.getCopyFromRevision() != null ? info.getCopyFromRevision().getNumber(): - 1; String copyUrl = info.getCopyFromURL() != null ? info.getCopyFromURL().toString() : null; String path = info.getFile() != null ? info.getFile().getName() : SVNPathUtil.tail(info.getPath()); if (path != null) { path = path.replace(File.separatorChar, '/'); info.getURL() != null ? info.getURL().toString() : null, info.getRepositoryUUID(), info.getRepositoryRootURL() != null ? info.getRepositoryRootURL().toString() : null, schedule, getNodeKind(info.getKind()), info.getAuthor(), info.getRevision() != null ? info.getRevision().getNumber() : -1, info.getCommittedRevision() != null ? info.getCommittedRevision().getNumber() : - 1, info.getCommittedDate(), info.getTextTime(), info.getPropTime(), info.getCopyFromRevision() != null || info.getCopyFromURL()!=null, deleted, absent, incomplete, copyRev, copyUrl );
if (SVNProperty.SCHEDULE_ADD.equals(info.getSchedule())) { schedule = ScheduleKind.add; } else if (SVNProperty.SCHEDULE_DELETE.equals(info.getSchedule())) { schedule = ScheduleKind.delete; File file = info.getFile(); boolean incomplete = false; long copyRev = info.getCopyFromRevision() != null ? info.getCopyFromRevision().getNumber(): - 1; String copyUrl = info.getCopyFromURL() != null ? info.getCopyFromURL().toString() : null; String path = info.getFile() != null ? info.getFile().getName() : SVNPathUtil.tail(info.getPath()); if (path != null) { path = path.replace(File.separatorChar, '/'); info.getURL() != null ? info.getURL().toString() : null, info.getRepositoryUUID(), info.getRepositoryRootURL() != null ? info.getRepositoryRootURL().toString() : null, schedule, getNodeKind(info.getKind()), info.getAuthor(), info.getRevision() != null ? info.getRevision().getNumber() : -1, info.getCommittedRevision() != null ? info.getCommittedRevision().getNumber() : - 1, info.getCommittedDate(),
svnInfo.getRevision() != null ? Long.toString( svnInfo.getRevision().getNumber() ) : null ); currentItem.setLastChangedAuthor( svnInfo.getAuthor() ); currentItem.setLastChangedRevision( svnInfo.getCommittedRevision() != null ? Long.toString( svnInfo.getCommittedRevision().getNumber() ) : null ); currentItem.setLastChangedDate( svnInfo.getCommittedDate() != null ? svnInfo.getCommittedDate().toString() : null ); currentItem.setURL( svnInfo.getURL() != null ? svnInfo.getURL().toString() : null ); currentItem.setRepositoryUUID( svnInfo.getRepositoryUUID() ); currentItem.setRepositoryRoot( svnInfo.getRepositoryRootURL() != null ? svnInfo.getRepositoryRootURL().toString() : null ); currentItem.setNodeKind( svnInfo.getKind() != null ? svnInfo.getKind().toString() : null ); return currentItem;
private String relativeUrl(SVNInfo info) { final String relativePath = SVNPathUtil.getRelativePath(info.getRepositoryRootURL().toString(), info.getURL().toString()); return "^/" + relativePath; }
public SvnInfo(SVNInfo info) { this(info.getURL().toDecodedString(), info.getCommittedRevision().getNumber()); }
@Override public String getTag() throws VCSException { try { File localRoot = getLocalRepository(); SVNInfo info = getSVNManager().getWCClient().doInfo(localRoot, SVNRevision.WORKING); String url = info.getURL().toDecodedString(); String result = "/trunk"; if (!url.endsWith("/trunk")) { // on est pas sur le trunk, on est soit sur un tag ou une // branche, dans les deux cas, il faut descendre de 2 / int i = url.lastIndexOf("/"); i = url.lastIndexOf("/", i - 1); result = url.substring(i); } return result; } catch (SVNException eee) { throw new VCSException(t("isisfish.vcs.vcssvn.gettag.error"), eee); } }
private SVNReference getReference(SVNRepository repository, String path, SVNRevision revision) { String url = repository.getUrl(path); SVNURL svnurl = SVNUtils.toURL(url); SVNInfo info = getInfo(repository, svnurl, revision); return new SVNReference( path, url, info.getRevision().getNumber(), Time.from(info.getCommittedDate(), null) ); }
private boolean isSameRepository(ModuleLocation location, SVNInfo svnkitInfo) throws SVNException { return location.getSVNURL().toString().startsWith(svnkitInfo.getRepositoryRootURL().toString()); }
@Override public String getFileVersion(String file) throws Exception { File f = new File(baseDirectory, file); if (!f.exists()) { return null; } SVNInfo info = ourClientManager.getWCClient().doInfo(f, SVNRevision.BASE); Log.logDebug(LOGGER, "SVN committed revision for file {0} is {1}", file, info.getCommittedRevision() .getNumber()); return Long.toString(info.getCommittedRevision().getNumber()); }
public void handleInfo( SVNInfo svnInfo ) throws SVNException { svnInfo.getAuthor(); } } );
@Override public String getHeadRevisionNumber(String path, String username, String password) throws AuthenticationException { if (log.isDebugEnabled()) { log.debug("headRevisionNumber expected " + addressSvn + " ; got " + path); } ISVNAuthenticationManager svnAuthManager = SVNWCUtil.createDefaultAuthenticationManager(username, password); DefaultSVNOptions svnOptions = new DefaultSVNOptions(); svnOptions.setPropertyValue(SVNProperty.EOL_STYLE, SVNProperty.EOL_STYLE_LF); SVNWCClient wcClient = new SVNWCClient(svnAuthManager, svnOptions); SVNInfo info = null; try { info = wcClient.doInfo(SVNURL.parseURIEncoded(path), SVNRevision.HEAD, SVNRevision.HEAD); } catch (SVNAuthenticationException e) { throw new AuthenticationException("Auth fail"); } catch (SVNException e) { if (log.isErrorEnabled()) { log.error("Can not get info from SVN repository", e); } } String headRevision = ""; if (info != null) { headRevision = info.getRevision().toString(); } return headRevision; }
if (SVNProperty.SCHEDULE_ADD.equals(info.getSchedule())) { schedule = ScheduleKind.add; } else if (SVNProperty.SCHEDULE_DELETE.equals(info.getSchedule())) { schedule = ScheduleKind.delete; long copyRev = info.getCopyFromRevision() != null ? info.getCopyFromRevision().getNumber() : -1; String copyUrl = info.getCopyFromURL() != null ? info.getCopyFromURL().toString() : null; String path = info.getFile() != null ? info.getFile().getAbsolutePath() : info.getPath(); if (path != null) { path = path.replace(File.separatorChar, '/'); int depth = info.getDepth() != null ? info.getDepth().getId() : Depth.unknown; return new Info2( path, info.getURL() != null ? info.getURL().toString() : null, info.getRevision() != null ? info.getRevision().getNumber() : -1, getNodeKind(info.getKind()), info.getRepositoryRootURL() != null ? info.getRepositoryRootURL().toString() : null, info.getRepositoryUUID(), info.getCommittedRevision() != null ? info.getCommittedRevision().getNumber() : - 1, info.getCommittedDate() != null ? info.getCommittedDate().getTime() * 1000 : 0, info.getAuthor(), createLock(info.getLock()), !info.isRemote(), schedule, copyUrl, copyRev, info.getTextTime() != null ? info.getTextTime().getTime() * 1000 : 0, info.getPropTime() != null ? info.getPropTime().getTime() * 1000 : 0, info.getChecksum(),
if (SVNProperty.SCHEDULE_ADD.equals(info.getSchedule())) { schedule = ScheduleKind.add; } else if (SVNProperty.SCHEDULE_DELETE.equals(info.getSchedule())) { schedule = ScheduleKind.delete; File file = info.getFile(); boolean incomplete = false; long copyRev = info.getCopyFromRevision() != null ? info.getCopyFromRevision().getNumber(): - 1; String copyUrl = info.getCopyFromURL() != null ? info.getCopyFromURL().toString() : null; String path = info.getFile() != null ? info.getFile().getName() : SVNPathUtil.tail(info.getPath()); if (path != null) { path = path.replace(File.separatorChar, '/'); info.getURL() != null ? info.getURL().toString() : null, info.getRepositoryUUID(), info.getRepositoryRootURL() != null ? info.getRepositoryRootURL().toString() : null, schedule, getNodeKind(info.getKind()), info.getAuthor(), info.getRevision() != null ? info.getRevision().getNumber() : -1, info.getCommittedRevision() != null ? info.getCommittedRevision().getNumber() : - 1, info.getCommittedDate(),
private void printInfoItem(SVNInfo info) throws SVNException { String targetPath = !myIsMultipleTargets ? null : (!myTargetIsPath ? info.getURL().toString() : getSVNEnvironment().getRelativePath(info.getFile())); printInfoItemString(info.getKind().toString(), targetPath); break; case URL: printInfoItemString(info.getURL().toString(), targetPath); break; case RELATIVE_URL: break; case REPS_ROOT_URL: printInfoItemString(info.getRepositoryRootURL().toString(), targetPath); break; case REPOS_UUID: printInfoItemString(info.getRepositoryUUID(), targetPath); break; case REVISION: printInfoItemRevision(info.getRevision(), targetPath); break; case LAST_CHANGED_REV: printInfoItemRevision(info.getCommittedRevision(), targetPath); break; case LAST_CHANGED_DATE: printInfoItemString(info.getCommittedDate() == null ? null : SVNDate.formatDate(info.getCommittedDate()), targetPath); break; case LAST_CHANGED_AUTHOR: printInfoItemString(info.getAuthor(), targetPath);
private String relativeUrl(SVNInfo info) { final String relativePath = SVNPathUtil.getRelativePath(info.getRepositoryRootURL().toString(), info.getURL().toString()); return "^/" + relativePath; }
public SvnInfo(SVNInfo info) { this( info.getURL().toDecodedString(), info.getCommittedRevision().getNumber() ); }
String wcUrl = svnInfo.getURL().toString();
public void process( @NotNull CmdLine cmdLine ) throws Exception { SVNClientManager manager = SVNClientManager.newInstance(); File current = new File( "." ); SVNWCClient client = manager.getWCClient(); SVNInfo info = client.doInfo( current.getCanonicalFile(), SVNRevision.WORKING ); if ( info == null ) { throw new IllegalStateException( "No info found for " + current.getCanonicalPath() ); } SVNURL actualUrl = info.getRepositoryRootURL(); String newUrl; try { newUrl = subversionSupport.getCorrespondingNewUrl( actualUrl ); } catch ( OldUrlNotFoundException ignore ) { newUrl = cmdLine.read( SubversionMessageHandler.get( "enter.new.url.for", actualUrl.toString() ), "" ); subversionSupport.addRepositoryUrl( newUrl ); subversionSupport.addOldRepositoryUrl( actualUrl.toString(), newUrl ); } cmdLine.out( SubversionMessageHandler.get( "module.switch.relocating", actualUrl, newUrl ) ); cmdLine.pause( 5 ); String command = subversionSupport.getSubversionBin() + " switch --relocate " + actualUrl + " " + newUrl; cmdLine.out( "---> " + command ); ProcessWrapper.runCommand( cmdLine, command ); cmdLine.success( SubversionMessageHandler.get( "module.processed.successfully" ) ); } }