public void lock(Map pathsToRevisions, String comment, boolean force, ISVNLockHandler handler) throws SVNException { try { openRepository(); for (Iterator paths = pathsToRevisions.keySet().iterator(); paths.hasNext();) { String path = (String) paths.next(); Long revision = (Long) pathsToRevisions.get(path); String reposPath = getRepositoryPath(path); long curRevision = (revision == null || isInvalidRevision(revision.longValue())) ? myFSFS.getYoungestRevision() : revision.longValue(); SVNLock lock = null; SVNErrorMessage error = null; try { lock = myFSFS.lockPath(reposPath, null, getUserName(), comment, null, curRevision, force); } catch (SVNException svne) { error = svne.getErrorMessage(); if (!FSErrors.isLockError(error)) { throw svne; } } if (handler != null) { handler.handleLock(reposPath, lock, error); } } } 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(); FSCommitEditor commitEditor = new FSCommitEditor(getRepositoryPath(""), logMessage, author, locks, keepLocks, null, myFSFS, this); return commitEditor; }
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(); FSCommitEditor commitEditor = new FSCommitEditor(getRepositoryPath(""), logMessage, author, locks, keepLocks, null, myFSFS, this); return commitEditor; }
public void lock(Map pathsToRevisions, String comment, boolean force, boolean isDAVComment, ISVNLockHandler handler) throws SVNException { try { openRepository(); for (Iterator paths = pathsToRevisions.keySet().iterator(); paths.hasNext();) { String path = (String) paths.next(); Long revision = (Long) pathsToRevisions.get(path); String reposPath = getRepositoryPath(path); long curRevision = (revision == null || isInvalidRevision(revision.longValue())) ? myFSFS.getYoungestRevision() : revision.longValue(); SVNLock lock = null; SVNErrorMessage error = null; try { lock = myFSFS.lockPath(reposPath, null, getUserName(), comment, null, curRevision, force, isDAVComment); } catch (SVNException svne) { error = svne.getErrorMessage(); if (!FSErrors.isLockError(error)) { throw svne; } } if (handler != null) { handler.handleLock(reposPath, lock, error); } } } 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 void lock(Map pathsToRevisions, String comment, boolean force, boolean isDAVComment, ISVNLockHandler handler) throws SVNException { try { openRepository(); for (Iterator paths = pathsToRevisions.keySet().iterator(); paths.hasNext();) { String path = (String) paths.next(); Long revision = (Long) pathsToRevisions.get(path); String reposPath = getRepositoryPath(path); long curRevision = (revision == null || isInvalidRevision(revision.longValue())) ? myFSFS.getYoungestRevision() : revision.longValue(); SVNLock lock = null; SVNErrorMessage error = null; try { lock = myFSFS.lockPath(reposPath, null, getUserName(), comment, null, curRevision, force, isDAVComment); } catch (SVNException svne) { error = svne.getErrorMessage(); if (!FSErrors.isLockError(error)) { throw svne; } } if (handler != null) { handler.handleLock(reposPath, lock, error); } } } 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(); FSCommitEditor commitEditor = new FSCommitEditor(getRepositoryPath(""), logMessage, author, locks, keepLocks, null, myFSFS, this); return commitEditor; }
public void lock(Map pathsToRevisions, String comment, boolean force, boolean isDAVComment, ISVNLockHandler handler) throws SVNException { try { openRepository(); for (Iterator paths = pathsToRevisions.keySet().iterator(); paths.hasNext();) { String path = (String) paths.next(); Long revision = (Long) pathsToRevisions.get(path); String reposPath = getRepositoryPath(path); long curRevision = (revision == null || isInvalidRevision(revision.longValue())) ? myFSFS.getYoungestRevision() : revision.longValue(); SVNLock lock = null; SVNErrorMessage error = null; try { lock = myFSFS.lockPath(reposPath, null, getUserName(), comment, null, curRevision, force, isDAVComment); } catch (SVNException svne) { error = svne.getErrorMessage(); if (!FSErrors.isLockError(error)) { throw svne; } } if (handler != null) { handler.handleLock(reposPath, lock, error); } } } finally { closeRepository(); } }
public void unlock(Map pathToTokens, boolean force, ISVNLockHandler handler) throws SVNException { try { openRepository(); for (Iterator paths = pathToTokens.keySet().iterator(); paths.hasNext();) { String path = (String) paths.next(); String token = (String) pathToTokens.get(path); String reposPath = getRepositoryPath(path); SVNErrorMessage error = null; try { myFSFS.unlockPath(reposPath, token, getUserName(), force, true); } catch (SVNException svne) { error = svne.getErrorMessage(); if (!FSErrors.isUnlockError(error)) { throw svne; } } if (handler != null) { handler.handleUnlock(reposPath, new SVNLock(reposPath, token, null, null, null, null), error); } } } finally { closeRepository(); } }
public void unlock(Map pathToTokens, boolean force, ISVNLockHandler handler) throws SVNException { try { openRepository(); for (Iterator paths = pathToTokens.keySet().iterator(); paths.hasNext();) { String path = (String) paths.next(); String token = (String) pathToTokens.get(path); String reposPath = getRepositoryPath(path); SVNErrorMessage error = null; try { myFSFS.unlockPath(reposPath, token, getUserName(), force, true); } catch (SVNException svne) { error = svne.getErrorMessage(); if (!FSErrors.isUnlockError(error)) { throw svne; } } if (handler != null) { handler.handleUnlock(reposPath, new SVNLock(reposPath, token, null, null, null, null), error); } } } finally { closeRepository(); } }
public void unlock(Map pathToTokens, boolean force, ISVNLockHandler handler) throws SVNException { try { openRepository(); for (Iterator paths = pathToTokens.keySet().iterator(); paths.hasNext();) { String path = (String) paths.next(); String token = (String) pathToTokens.get(path); String reposPath = getRepositoryPath(path); SVNErrorMessage error = null; try { myFSFS.unlockPath(reposPath, token, getUserName(), force); } catch (SVNException svne) { error = svne.getErrorMessage(); if (!FSErrors.isUnlockError(error)) { throw svne; } } if (handler != null) { handler.handleUnlock(reposPath, new SVNLock(reposPath, token, null, null, null, null), error); } } } finally { closeRepository(); } }
public void unlock(Map pathToTokens, boolean force, ISVNLockHandler handler) throws SVNException { try { openRepository(); for (Iterator paths = pathToTokens.keySet().iterator(); paths.hasNext();) { String path = (String) paths.next(); String token = (String) pathToTokens.get(path); String reposPath = getRepositoryPath(path); SVNErrorMessage error = null; try { myFSFS.unlockPath(reposPath, token, getUserName(), force, true); } catch (SVNException svne) { error = svne.getErrorMessage(); if (!FSErrors.isUnlockError(error)) { throw svne; } } if (handler != null) { handler.handleUnlock(reposPath, new SVNLock(reposPath, token, null, null, null, null), error); } } } finally { closeRepository(); } }
protected ISVNEditor getCommitEditorInternal(Map locks, boolean keepLocks, SVNProperties revProps, ISVNWorkspaceMediator mediator) throws SVNException { try { openRepository(); } catch (SVNException svne) { closeRepository(); throw svne; } revProps = revProps == null ? new SVNProperties() : revProps; if (!revProps.containsName(SVNRevisionProperty.AUTHOR)) { revProps.put(SVNRevisionProperty.AUTHOR, getUserName()); } return new FSCommitEditor(getRepositoryPath(""), locks, keepLocks, null, myFSFS, this, revProps); }
protected ISVNEditor getCommitEditorInternal(Map locks, boolean keepLocks, SVNProperties revProps, ISVNWorkspaceMediator mediator) throws SVNException { try { openRepository(); } catch (SVNException svne) { closeRepository(); throw svne; } revProps = revProps == null ? new SVNProperties() : revProps; if (!revProps.containsName(SVNRevisionProperty.AUTHOR)) { revProps.put(SVNRevisionProperty.AUTHOR, getUserName()); } return new FSCommitEditor(getRepositoryPath(""), locks, keepLocks, null, myFSFS, this, revProps); }
protected ISVNEditor getCommitEditorInternal(Map locks, boolean keepLocks, SVNProperties revProps, ISVNWorkspaceMediator mediator) throws SVNException { try { openRepository(); } catch (SVNException svne) { closeRepository(); throw svne; } revProps = revProps == null ? new SVNProperties() : revProps; if (!revProps.containsName(SVNRevisionProperty.AUTHOR)) { revProps.put(SVNRevisionProperty.AUTHOR, getUserName()); } return new FSCommitEditor(getRepositoryPath(""), locks, keepLocks, null, myFSFS, this, revProps); }
public void setRevisionPropertyValue(long revision, String propertyName, String propertyValue) throws SVNException { assertValidRevision(revision); try { openRepository(); if (!SVNProperty.isRegularProperty(propertyName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_BAD_ARGS, "Storage of non-regular property ''{0}'' is disallowed through the repository interface, and could indicate a bug in your client", propertyName); SVNErrorManager.error(err); } String userName = getUserName(); Map revProps = myFSFS.getRevisionProperties(revision); String oldValue = (String)revProps.get(propertyName); String action = null; if (propertyValue == null) { action = FSHooks.REVPROP_DELETE; } else if (oldValue == null) { action = FSHooks.REVPROP_ADD; } else { action = FSHooks.REVPROP_MODIFY; } FSHooks.runPreRevPropChangeHook(myReposRootDir, propertyName, propertyValue, userName, revision, action); myFSFS.setRevisionProperty(revision, propertyName, propertyValue); FSHooks.runPostRevPropChangeHook(myReposRootDir, propertyName, propertyValue, userName, revision, action); } finally { 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 (FSHooks.isHooksEnabled() && !bypassPreRevpropHook) { FSHooks.runPreRevPropChangeHook(myReposRootDir, propertyName, bytes, userName, revision, action); } myFSFS.setRevisionProperty(revision, propertyName, propertyValue); if (FSHooks.isHooksEnabled() && !bypassPostRevpropHook) { FSHooks.runPostRevPropChangeHook(myReposRootDir, propertyName, bytes, userName, revision, action); } } finally { 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 (FSHooks.isHooksEnabled() && !bypassPreRevpropHook) { FSHooks.runPreRevPropChangeHook(myReposRootDir, propertyName, bytes, userName, revision, action); } myFSFS.setRevisionProperty(revision, propertyName, propertyValue); if (FSHooks.isHooksEnabled() && !bypassPostRevpropHook) { FSHooks.runPostRevPropChangeHook(myReposRootDir, propertyName, bytes, userName, revision, action); } } finally { 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(); } }