public void setRevisionPropertyValue(long revision, String propertyName, SVNPropertyValue propertyValue) throws SVNException { setRevisionPropertyValue(revision, propertyName, propertyValue, false); }
public DAVResource(DAVRepositoryManager manager, SVNRepository repository, DAVResourceURI resourceURI, long revision, boolean isSVNClient, String deltaBase, long version, String clientOptions, String baseChecksum, String resultChecksum, String userName, File activitiesDB, Collection lockTokens, Map clientCapabilities) { myRepositoryManager = manager; myResourceURI = resourceURI; myRepository = (FSRepository) repository; myFSFS = myRepository.getFSFS(); myRevision = revision; myIsSVNClient = isSVNClient; myDeltaBase = deltaBase; myVersion = version; myClientOptions = clientOptions; myBaseChecksum = baseChecksum; myResultChecksum = resultChecksum; myUserName = userName; myActivitiesDB = activitiesDB; myLockTokens = lockTokens; myClientCapabilities = clientCapabilities; }
public long getDatedRevision(Date date) throws SVNException { if (date == null) { return getLatestRevision(); } try { openRepository(); return myFSFS.getDatedRevision(date); } finally { closeRepository(); } }
public void testConnection() throws SVNException { // try to open and close a repository try { openRepository(); } finally { closeRepository(); } }
protected long getLocationSegmentsImpl(String path, long pegRevision, long startRevision, long endRevision, ISVNLocationSegmentHandler handler) throws SVNException { try { openRepository(); path = getRepositoryPath(path); FSLocationsFinder locationsFinder = getLocationsFinder(); return locationsFinder.getNodeLocationSegments(path, pegRevision, startRevision, endRevision, handler); } finally { closeRepository(); } }
public ISVNEditor getCommitEditor(String logMessage, Map locks, boolean keepLocks, ISVNWorkspaceMediator mediator) throws SVNException { try { openRepository(); } catch (SVNException svne) { closeRepository(); throw svne; } // fetch user name! String author = getUserName(); return new FSCommitEditor(getRepositoryPath(""), logMessage, author, locks, keepLocks, null, myFSFS, this); }
public SVNDirEntry info(String path, long revision) throws SVNException { try { openRepository(); path = getRepositoryPath(path); if (FSRepository.isInvalidRevision(revision)) { revision = myFSFS.getYoungestRevision(); } FSRevisionRoot root = myFSFS.createRevisionRoot(revision); if (root.checkNodeKind(path) == SVNNodeKind.NONE) { return null; } FSRevisionNode revNode = root.getRevisionNode(path); String fullPath = getFullPath(path); String parentFullPath = "/".equals(path) ? fullPath : SVNPathUtil.removeTail(fullPath); SVNURL url = getLocation().setPath(parentFullPath, false); String name = "/".equals(path) ? "" : SVNPathUtil.tail(path); FSEntry fsEntry = new FSEntry(revNode.getId(), revNode.getType(), name); SVNDirEntry entry = buildDirEntry(fsEntry, url, revNode, SVNDirEntry.DIRENT_ALL); return entry; } finally { closeRepository(); } }
public SVNDirEntry getDir(String path, long revision, boolean includeCommitMessages, Collection entries) throws SVNException { try { openRepository(); if (!SVNRepository.isValidRevision(revision)) { revision = myFSFS.getYoungestRevision(); } String repositoryPath = getRepositoryPath(path); SVNURL parentURL = getLocation().appendPath(path, false); FSRevisionRoot root = myFSFS.createRevisionRoot(revision); FSRevisionNode parent = root.getRevisionNode(repositoryPath); if (entries != null) { entries.addAll(getDirEntries(parent, parentURL, SVNDirEntry.DIRENT_ALL)); } SVNDirEntry parentDirEntry = buildDirEntry(new FSEntry(parent.getId(), parent.getType(), ""), parentURL, parent, SVNDirEntry.DIRENT_ALL); return parentDirEntry; } finally { closeRepository(); } }
public long getDir(String path, long revision, Map properties, ISVNDirEntryHandler handler) throws SVNException { try { openRepository(); if (!SVNRepository.isValidRevision(revision)) { revision = myFSFS.getYoungestRevision(); } String repositoryPath = getRepositoryPath(path); FSRevisionRoot root = myFSFS.createRevisionRoot(revision); FSRevisionNode parent = root.getRevisionNode(repositoryPath); if (handler != null) { SVNURL parentURL = getLocation().appendPath(path, false); Collection entriesCollection = getDirEntries(parent, parentURL, false); Iterator entries = entriesCollection.iterator(); while (entries.hasNext()) { SVNDirEntry entry = (SVNDirEntry) entries.next(); handler.handleDirEntry(entry); } } if (properties != null) { properties.putAll(collectProperties(parent)); } return revision; } finally { closeRepository(); } }
public long getFile(String path, long revision, Map properties, OutputStream contents) throws SVNException { try { openRepository(); if (!SVNRepository.isValidRevision(revision)) { revision = myFSFS.getYoungestRevision(); String repositoryPath = getRepositoryPath(path); FSRevisionRoot root = myFSFS.createRevisionRoot(revision); properties.putAll(collectProperties(revNode)); closeRepository();
public void setRevisionPropertyValue(long revision, String propertyName, SVNPropertyValue propertyValue, boolean bypassPreRevpropHook, boolean bypassPostRevpropHook) throws SVNException { assertValidRevision(revision); try { openRepository(); FSRepositoryUtil.validateProperty(propertyName, propertyValue); String userName = getUserName(); SVNProperties revProps = myFSFS.getRevisionProperties(revision); SVNPropertyValue oldValue = revProps.getSVNPropertyValue(propertyName); String action = null; if (propertyValue == null) { action = FSHooks.REVPROP_DELETE; } else if (oldValue == null) { action = FSHooks.REVPROP_ADD; } else { action = FSHooks.REVPROP_MODIFY; } byte[] bytes = SVNPropertyValue.getPropertyAsBytes(propertyValue); if (isHooksEnabled() && FSHooks.isHooksEnabled() && !bypassPreRevpropHook) { FSHooks.runPreRevPropChangeHook(myReposRootDir, propertyName, bytes, userName, revision, action); } myFSFS.setRevisionProperty(revision, propertyName, propertyValue); if (isHooksEnabled() && FSHooks.isHooksEnabled() && !bypassPostRevpropHook) { FSHooks.runPostRevPropChangeHook(myReposRootDir, propertyName, bytes, userName, revision, action); } } finally { closeRepository(); } }
public String getRevisionPropertyValue(long revision, String propertyName) throws SVNException { assertValidRevision(revision); if (propertyName == null) { return null; } try { openRepository(); return (String) myFSFS.getRevisionProperties(revision).get(propertyName); } finally { closeRepository(); } }
public void update(long revision, String target, SVNDepth depth, boolean sendCopyFromArgs, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException { try { openRepository(); makeReporterContext(revision, target, null, depth, false, true, sendCopyFromArgs, editor); reporter.report(this); } finally { closeRepository(); } }
SVNURL url = SVNURL.fromFile(repos); FSRepository repository = (FSRepository) SVNRepositoryFactory.create(url); long rev = getRevisionNumber(getSVNAdminEnvironment().getStartRevision(), repository.getLatestRevision(), repository); repository.setRevisionPropertyValue(rev, propertyName, propertyValue, !getSVNAdminEnvironment().isUsePreRevPropChangeHook(), !getSVNAdminEnvironment().isUsePostRevPropChangeHook());
myRepository.setCanceller(this); myRepository.testConnection(); if (getTransaction() != null) { myTransactionInfo = myRepository.getFSFS().openTxn(getTransaction()); } else { if (myRevision < 0) { myRevision = myRepository.getLatestRevision();
protected long getDeletedRevisionImpl(String path, long pegRevision, long endRevision) throws SVNException { try { openRepository(); path = getRepositoryPath(path); return myFSFS.getDeletedRevision(path, pegRevision, endRevision); } finally { closeRepository(); } }
private String getUserName() throws SVNException { if (getLocation().getUserInfo() != null && getLocation().getUserInfo().trim().length() > 0) { return getLocation().getUserInfo(); if (getAuthenticationManager() != null) { try { String realm = getRepositoryUUID(true); ISVNAuthenticationManager authManager = getAuthenticationManager(); SVNAuthentication auth = authManager.getFirstAuthentication(ISVNAuthenticationManager.USERNAME, realm, getLocation()); auth = authManager.getNextAuthentication(ISVNAuthenticationManager.USERNAME, realm, getLocation());
public int getLocations(String path, long pegRevision, long[] revisions, ISVNLocationEntryHandler handler) throws SVNException { assertValidRevision(pegRevision); for (int i = 0; i < revisions.length; i++) { assertValidRevision(revisions[i]); openRepository(); path = getRepositoryPath(path); ArrayList locationEntries = new ArrayList(0); long[] locationRevs = new long[revisions.length]; while (count < revisions.length) { root = myFSFS.createRevisionRoot(revision); FSClosestCopy tempClCopy = closestCopy(root, path); if (tempClCopy == null) { break; closeRepository();
public long getDatedRevision(Date date) throws SVNException { if (date == null) { return getLatestRevision(); openRepository(); long latest = myFSFS.getYoungestRevision(); long top = latest; currentTime = getRevisionTime(middle); if (currentTime.compareTo(date) > 0) { if ((middle - 1) < 0) { return 0; Date prevTime = getRevisionTime(middle - 1); if (prevTime.compareTo(date) < 0) { return middle - 1; return latest; Date nextTime = getRevisionTime(middle + 1); if (nextTime.compareTo(date) > 0) { return middle + 1; closeRepository();
protected FSRoot getFSRoot() throws SVNException { FSRepository repository = getSVNLookEnvironment().getRepository(); if (getSVNLookEnvironment().isRevision()) { long rev = getSVNLookEnvironment().getRevision(); if (rev < 0) { rev = repository.getLatestRevision(); } return repository.getFSFS().createRevisionRoot(rev); } return repository.getFSFS().createTransactionRoot(getSVNLookEnvironment().getTransactionInfo()); }