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(); } }