private void unlock(SVNRepository repos) throws SVNException { repos.setRevisionPropertyValue(0, SVNRevisionProperty.LOCK, null); }
private void unlock(SVNRepository repos) throws SVNException { repos.setRevisionPropertyValue(0, SVNRevisionProperty.LOCK, null); }
private void unlock(SVNRepository repos) throws SVNException { repos.setRevisionPropertyValue(0, SVNRevisionProperty.LOCK, null); }
private void unlock(SVNRepository repos) throws SVNException { repos.setRevisionPropertyValue(0, SVNRevisionProperty.LOCK, null); }
public static int writeRevisionProperties(SVNRepository toRepository, long revision, SVNProperties revProps) throws SVNException { int filteredCount = 0; for (Iterator propNamesIter = revProps.nameSet().iterator(); propNamesIter.hasNext();) { String propName = (String) propNamesIter.next(); SVNPropertyValue propValue = revProps.getSVNPropertyValue(propName); if (propName.startsWith(SVNProperty.SVN_SYNC_PREFIX)) { filteredCount++; } else { toRepository.setRevisionPropertyValue(revision, propName, propValue); } } return filteredCount; }
public static void removePropertiesNotInSource(SVNRepository repository, long revision, SVNProperties sourceProps, SVNProperties targetProps) throws SVNException { for (Iterator propNamesIter = targetProps.nameSet().iterator(); propNamesIter.hasNext();) { String propName = (String) propNamesIter.next(); if (sourceProps.getSVNPropertyValue(propName) == null) { repository.setRevisionPropertyValue(revision, propName, null); } } }
public static int writeRevisionProperties(SVNRepository toRepository, long revision, SVNProperties revProps) throws SVNException { int filteredCount = 0; for (Iterator propNamesIter = revProps.nameSet().iterator(); propNamesIter.hasNext();) { String propName = (String) propNamesIter.next(); SVNPropertyValue propValue = revProps.getSVNPropertyValue(propName); if (propName.startsWith(SVNProperty.SVN_SYNC_PREFIX)) { filteredCount++; } else { toRepository.setRevisionPropertyValue(revision, propName, propValue); } } return filteredCount; }
public static void removePropertiesNotInSource(SVNRepository repository, long revision, SVNProperties sourceProps, SVNProperties targetProps) throws SVNException { for (Iterator propNamesIter = targetProps.nameSet().iterator(); propNamesIter.hasNext();) { String propName = (String) propNamesIter.next(); if (sourceProps.getSVNPropertyValue(propName) == null) { repository.setRevisionPropertyValue(revision, propName, null); } } }
public static void removePropertiesNotInSource(SVNRepository repository, long revision, SVNProperties sourceProps, SVNProperties targetProps) throws SVNException { for (Iterator propNamesIter = targetProps.nameSet().iterator(); propNamesIter.hasNext();) { String propName = (String) propNamesIter.next(); if (sourceProps.getSVNPropertyValue(propName) == null) { repository.setRevisionPropertyValue(revision, propName, null); } } }
public static int writeRevisionProperties(SVNRepository toRepository, long revision, SVNProperties revProps) throws SVNException { int filteredCount = 0; for (Iterator propNamesIter = revProps.nameSet().iterator(); propNamesIter.hasNext();) { String propName = (String) propNamesIter.next(); SVNPropertyValue propValue = revProps.getSVNPropertyValue(propName); if (propName.startsWith(SVNProperty.SVN_SYNC_PREFIX)) { filteredCount++; } else { toRepository.setRevisionPropertyValue(revision, propName, propValue); } } return filteredCount; }
private void updateRevisionProperties(SVNRepository repository, long revision, Map properties) throws SVNCancelException, SVNException { if (!properties.containsKey(SVNRevisionProperty.AUTHOR)) { properties.put(SVNRevisionProperty.AUTHOR, null); } if (!properties.containsKey(SVNRevisionProperty.DATE)) { properties.put(SVNRevisionProperty.DATE, null); } if (!properties.containsKey(SVNRevisionProperty.LOG)) { properties.put(SVNRevisionProperty.LOG, null); } for (Iterator names = properties.keySet().iterator(); names.hasNext();) { checkCancelled(); String name = (String) names.next(); String value = (String) properties.get(name); if (name != null) { repository.setRevisionPropertyValue(revision, name, value); } } }
public void changeRevisionProperty(long revision, String propertyName, byte[] oldValue, byte[] newValue) throws ClientException { try { svnRepository.setRevisionPropertyValue(revision, propertyName, SVNPropertyValue.create(propertyName, newValue)); } catch (SVNException e) { throw ClientException.fromException(e); } }
private void updateRevisionProperties(SVNRepository repository, long revision, SVNProperties properties) throws SVNException { if (!properties.containsName(SVNRevisionProperty.AUTHOR)) { properties.put(SVNRevisionProperty.AUTHOR, (byte[]) null); } if (!properties.containsName(SVNRevisionProperty.DATE)) { properties.put(SVNRevisionProperty.DATE, (byte[]) null); } if (!properties.containsName(SVNRevisionProperty.LOG)) { properties.put(SVNRevisionProperty.LOG, (byte[]) null); } for (Iterator names = properties.nameSet().iterator(); names.hasNext();) { checkCancelled(); String name = (String) names.next(); SVNPropertyValue value = properties.getSVNPropertyValue(name); repository.setRevisionPropertyValue(revision, name, value); } }
private void updateRevisionProperties(SVNRepository repository, long revision, SVNProperties properties) throws SVNException { if (!properties.containsName(SVNRevisionProperty.AUTHOR)) { properties.put(SVNRevisionProperty.AUTHOR, (byte[]) null); } if (!properties.containsName(SVNRevisionProperty.DATE)) { properties.put(SVNRevisionProperty.DATE, (byte[]) null); } if (!properties.containsName(SVNRevisionProperty.LOG)) { properties.put(SVNRevisionProperty.LOG, (byte[]) null); } for (Iterator names = properties.nameSet().iterator(); names.hasNext();) { checkCancelled(); String name = (String) names.next(); SVNPropertyValue value = properties.getSVNPropertyValue(name); repository.setRevisionPropertyValue(revision, name, value); } }
private void updateRevisionProperties(SVNRepository repository, long revision, SVNProperties properties) throws SVNException { if (!properties.containsName(SVNRevisionProperty.AUTHOR)) { properties.put(SVNRevisionProperty.AUTHOR, (byte[]) null); } if (!properties.containsName(SVNRevisionProperty.DATE)) { properties.put(SVNRevisionProperty.DATE, (byte[]) null); } if (!properties.containsName(SVNRevisionProperty.LOG)) { properties.put(SVNRevisionProperty.LOG, (byte[]) null); } for (Iterator names = properties.nameSet().iterator(); names.hasNext();) { checkCancelled(); String name = (String) names.next(); SVNPropertyValue value = properties.getSVNPropertyValue(name); repository.setRevisionPropertyValue(revision, name, value); } }
/** * @param revision * @param revisionProperties * @param editor * @throws SVNException */ public void handleEndRevision(long revision, SVNProperties revisionProperties, ISVNEditor editor) throws SVNException { editor.closeEdit(); if (mySyncEditor.getCommitInfo().getNewRevision() != revision) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Commit created rev {0} but should have created {1}", new Object[] { String.valueOf(mySyncEditor.getCommitInfo().getNewRevision()), String.valueOf(revision) }); SVNErrorManager.error(err, SVNLogType.FSFS); } SVNProperties existingProperties = myTargetRepository.getRevisionProperties(revision, null); SVNProperties filtered = new SVNProperties(); filterProperties(revisionProperties, filtered, false); SVNProperties normalizedProps = SVNAdminClient.normalizeRevisionProperties(filtered); myNormalizedRevPropsCount += normalizedProps.size(); int filteredCount = SVNAdminHelper.writeRevisionProperties(myTargetRepository, revision, filtered); SVNAdminHelper.removePropertiesNotInSource(myTargetRepository, revision, revisionProperties, existingProperties); myTargetRepository.setRevisionPropertyValue(0, SVNRevisionProperty.LAST_MERGED_REVISION, SVNPropertyValue.create(SVNProperty.toString(revision))); myTargetRepository.setRevisionPropertyValue(0, SVNRevisionProperty.CURRENTLY_COPYING, null); myAdminClient.handlePropertesCopied(filteredCount > 0, revision); }
/** * @param revision * @param revisionProperties * @return editor to replicate the revision * @throws SVNException */ public ISVNEditor handleStartRevision(long revision, SVNProperties revisionProperties) throws SVNException { myTargetRepository.setRevisionPropertyValue(0, SVNRevisionProperty.CURRENTLY_COPYING, SVNPropertyValue.create(SVNProperty.toString(revision))); SVNProperties filtered = new SVNProperties(); filterProperties(revisionProperties, filtered, true); if (!filtered.containsName(SVNRevisionProperty.LOG)) { filtered.put(SVNRevisionProperty.LOG, ""); } SVNProperties normalizedProps = SVNAdminClient.normalizeRevisionProperties(filtered); myNormalizedRevPropsCount += normalizedProps.size(); if (mySyncEditor == null) { mySyncEditor = new SVNSynchronizeEditor(myTargetRepository, myLogEntryHandler, revision - 1, filtered); } else { mySyncEditor.reset(revision - 1, filtered); } ISVNEditor cancellableEditor = SVNCancellableEditor.newInstance(mySyncEditor, myCanceller, myDebugLog); return cancellableEditor; }
/** * @param revision * @param revisionProperties * @return editor to replicate the revision * @throws SVNException */ public ISVNEditor handleStartRevision(long revision, SVNProperties revisionProperties) throws SVNException { myTargetRepository.setRevisionPropertyValue(0, SVNRevisionProperty.CURRENTLY_COPYING, SVNPropertyValue.create(SVNProperty.toString(revision))); SVNProperties filtered = new SVNProperties(); filterProperties(revisionProperties, filtered, true); if (!filtered.containsName(SVNRevisionProperty.LOG)) { filtered.put(SVNRevisionProperty.LOG, ""); } SVNProperties normalizedProps = SVNAdminClient.normalizeRevisionProperties(filtered); myNormalizedRevPropsCount += normalizedProps.size(); if (mySyncEditor == null) { mySyncEditor = new SVNSynchronizeEditor(myTargetRepository, myLogEntryHandler, revision - 1, filtered); } else { mySyncEditor.reset(revision - 1, filtered); } ISVNEditor cancellableEditor = SVNCancellableEditor.newInstance(mySyncEditor, myCanceller, myDebugLog); return cancellableEditor; }
/** * @param revision * @param revisionProperties * @return editor to replicate the revision * @throws SVNException */ public ISVNEditor handleStartRevision(long revision, SVNProperties revisionProperties) throws SVNException { myTargetRepository.setRevisionPropertyValue(0, SVNRevisionProperty.CURRENTLY_COPYING, SVNPropertyValue.create(SVNProperty.toString(revision))); SVNProperties filtered = new SVNProperties(); filterProperties(revisionProperties, filtered, true); if (!filtered.containsName(SVNRevisionProperty.LOG)) { filtered.put(SVNRevisionProperty.LOG, ""); } SVNProperties normalizedProps = SVNAdminClient.normalizeRevisionProperties(filtered); myNormalizedRevPropsCount += normalizedProps.size(); if (mySyncEditor == null) { mySyncEditor = new SVNSynchronizeEditor(myTargetRepository, myLogEntryHandler, revision - 1, filtered); } else { mySyncEditor.reset(revision - 1, filtered); } ISVNEditor cancellableEditor = SVNCancellableEditor.newInstance(mySyncEditor, myCanceller, myDebugLog); return cancellableEditor; }
public void removeProperty(DAVElement propName) throws DAVException { String reposPropName = getReposPropName(propName); if (reposPropName == null) { return; } try { FSFS fsfs = myResource.getFSFS(); if (myResource.isBaseLined()) { if (myResource.isWorking()) { FSTransactionInfo txn = myResource.getTxnInfo(); SVNProperties props = new SVNProperties(); props.put(reposPropName, (SVNPropertyValue) null); fsfs.changeTransactionProperties(txn.getTxnId(), props); } else { SVNRepository repos = myResource.getRepository(); repos.setRevisionPropertyValue(myResource.getRevision(), reposPropName, null); } } else { DAVResourceURI resourceURI = myResource.getResourceURI(); FSCommitter committer = getCommitter(); committer.changeNodeProperty(resourceURI.getPath(), reposPropName, null); } } catch (SVNException svne) { throw DAVException.convertError(svne.getErrorMessage(), HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "could not remove a property", null); } myProperties = null; }