DAVRepositoryFactory.setup(); String url = "(directory in svn url)"; String name = "(login name)"; String password = "(login password)"; SVNRepository repository = null; repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url)); ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(name, password); repository.setAuthenticationManager(authManager); SVNDirEntry entry = repository.info(".", -1); System.out.println("Latest Rev: " + entry.getRevision());
@Override public void handleDirEntry(final SVNDirEntry dirEntry) throws SVNException { if (!dirEntry.getKind().equals(SVNNodeKind.DIR)) { return; } String directoryName = Util.removeTrailingSlash(dirEntry.getName()); dirs.put(Long.valueOf(dirEntry.getRevision()), directoryName); } }
public long getLatestRevision() throws SVNException { List<Long> revs; SVNDirEntry dir; if (root.getRepository().checkPath(path, -1) == SVNNodeKind.DIR) { dir = root.getRepository().getDir(path, -1, false, new ArrayList<>()); return dir.getRevision(); } else { revs = getRevisions(); return revs.get(revs.size() - 1); } }
public long getLatestRevision() throws SVNException { List<Long> revs; SVNDirEntry dir; if (root.getRepository().checkPath(path, -1) == SVNNodeKind.DIR) { dir = root.getRepository().getDir(path, -1, false, new ArrayList<Object>()); return dir.getRevision(); } else { revs = getRevisions(); return revs.get(revs.size() - 1); } }
public void handleDirEntry(SVNDirEntry entry) throws SVNException { children.add( new ChildEntry(entry.getRevision(), entry.getDate().getTime(), entry.getKind(), entry.getName())); }
static SVNInfo createInfo(String path, SVNURL reposRootURL, String uuid, SVNURL url, SVNRevision revision, SVNDirEntry dirEntry, SVNLock lock) { if (dirEntry == null) { return null; } return new SVNInfo(path, url, revision, dirEntry.getKind(), uuid, reposRootURL, dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor(), lock); }
public SCMRepository info() { SVNRepository repository = null; try { SVNURL url = SVNURL.parseURIEncoded(path); repository = SVNRepositoryFactory.create(url); authenticateIfNecessary(repository); SVNDirEntry firstRevision = repository.info("/", 0); SVNDirEntry lastRevision = repository.info("/", SVNRevision.HEAD.getNumber()); return new SCMRepository(this, lastRevision.getURL().getPath(), path, String.valueOf(lastRevision.getRevision()), String.valueOf(firstRevision .getRevision())); } catch (SVNException e) { throw new RuntimeException("error in getHead() for " + path, e); } finally { if (repository != null) repository.closeSession(); } }
static SVNInfo createInfo(String path, SVNURL reposRootURL, String uuid, SVNURL url, SVNRevision revision, SVNDirEntry dirEntry, SVNLock lock) { if (dirEntry == null) { return null; } return new SVNInfo(path, url, revision, dirEntry.getKind(), uuid, reposRootURL, dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor(), lock, SVNDepth.UNKNOWN, dirEntry.getSize()); }
public static SVNInfo createInfo(String path, SVNURL reposRootURL, String uuid, SVNURL url, SVNRevision revision, SVNDirEntry dirEntry, SVNLock lock) { if (dirEntry == null) { return null; } return new SVNInfo(path, url, revision, dirEntry.getKind(), uuid, reposRootURL, dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor(), lock, SVNDepth.UNKNOWN, dirEntry.getSize()); }
static SVNInfo createInfo(String path, SVNURL reposRootURL, String uuid, SVNURL url, SVNRevision revision, SVNDirEntry dirEntry, SVNLock lock) { if (dirEntry == null) { return null; } return new SVNInfo(path, url, revision, dirEntry.getKind(), uuid, reposRootURL, dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor(), lock, SVNDepth.UNKNOWN, dirEntry.getSize()); }
@Override public ChangeSet getHead() { SVNRepository repository = null; try { SVNURL url = SVNURL.parseURIEncoded(path); repository = SVNRepositoryFactory.create(url); authenticateIfNecessary(repository); SVNDirEntry entry = repository.info("/", -1); return new ChangeSet(String.valueOf(entry.getRevision()), convertToCalendar(entry.getDate())); } catch (SVNException e) { throw new RuntimeException("error in getHead() for " + path, e); } finally { if (repository != null) repository.closeSession(); } }
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { if (entries != null) { dirEntry = new SVNDirEntry(url.appendPath(dirEntry.getName(), false), repositoryRoot, dirEntry.getName(), dirEntry.getKind(), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor()); entries.add(dirEntry); } } };
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { if (entries != null) { dirEntry = new SVNDirEntry(url.appendPath(dirEntry.getName(), false), repositoryRoot, dirEntry.getName(), dirEntry.getKind(), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor()); entries.add(dirEntry); } } };
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { if (entries != null) { dirEntry = new SVNDirEntry(url.appendPath(dirEntry.getName(), false), repositoryRoot, dirEntry.getName(), dirEntry.getKind(), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor()); entries.add(dirEntry); } } };
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { dirEntry = new SVNDirEntry(url.appendPath(dirEntry.getName(), false), dirEntry.getName(), dirEntry.getKind(), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor()); entries.add(dirEntry); } };
public static DirEntry createDirEntry(SVNDirEntry dirEntry) { if(dirEntry == null){ return null; } return new DirEntry( dirEntry.getRelativePath(), getNodeKind(dirEntry.getKind()), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate() != null ? dirEntry.getDate().getTime()*1000 : 0, dirEntry.getAuthor() ); }
protected static DirEntry getDirEntry(SVNDirEntry dirEntry, String reposRelativePath) { if (dirEntry == null) { return null; } return new DirEntry(dirEntry.getRelativePath(), SVNPathUtil.append(reposRelativePath, dirEntry.getRelativePath()), SVNClientImpl.getNodeKind(dirEntry.getKind()), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate().getTime(), dirEntry.getAuthor()); }
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { handler.handleDirEntry(new SVNDirEntry(url.appendPath(dirEntry.getName(), false), dirEntry.getName(), dirEntry.getKind(), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor())); } };
private DirEntry getDirEntry(SVNDirEntry dirEntry) { if (dirEntry == null) { return null; } String repositoryRootString = getUrlString(dirEntry.getRepositoryRoot()); String urlString = getUrlString(dirEntry.getURL()); String absolutePath = SVNPathUtil.getRelativePath(repositoryRootString, urlString); return new DirEntry(dirEntry.getRelativePath(), absolutePath, getNodeKind(dirEntry.getKind()), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), getLongDate(dirEntry.getDate()), dirEntry.getAuthor()); }
private SvnInfo creatSvnInfoForEntry(SVNURL root, String uuid, SVNDirEntry entry, SVNURL entryURL, long revision, SVNLock lock) { SvnInfo info = new SvnInfo(); info.setKind(entry.getKind()); info.setLastChangedAuthor(entry.getAuthor()); info.setLastChangedDate(SVNDate.fromDate(entry.getDate())); info.setLastChangedRevision(entry.getRevision()); info.setLock(lock); info.setRepositoryRootURL(root); info.setRepositoryUuid(uuid); info.setSize(entry.getSize()); info.setUrl(entryURL); info.setRevision(revision); return info; }