public static boolean hasMagicProperty(SVNProperties properties) { for (Iterator<String> i = properties.nameSet().iterator(); i.hasNext();) { String property = i.next(); if (SVNProperty.EXECUTABLE.equals(property) || SVNProperty.KEYWORDS.equals(property) || SVNProperty.EOL_STYLE.equals(property) || SVNProperty.SPECIAL.equals(property) || SVNProperty.NEEDS_LOCK.equals(property)) return true; } return false; }
private static boolean hasSVNProperties(SVNProperties props) { if (props == null) { return false; } for (Iterator names = props.nameSet().iterator(); names.hasNext();) { String propName = (String) names.next(); if (SVNProperty.isSVNProperty(propName)) { return true; } } return false; }
private static boolean hasSVNProperties(SVNProperties props) { if (props == null) { return false; } for (Iterator names = props.nameSet().iterator(); names.hasNext();) { String propName = (String) names.next(); if (SVNProperty.isSVNProperty(propName)) { return true; } } return false; }
public Collection getPropertyNames(Collection target) throws SVNException { SVNProperties props = loadProperties(); target = target == null ? new TreeSet() : target; if (isEmpty()) { return target; } for (Iterator names = props.nameSet().iterator(); names.hasNext();) { target.add(names.next()); } return target; }
public Collection getPropertyNames(Collection target) throws SVNException { SVNProperties props = loadProperties(); target = target == null ? new TreeSet() : target; if (isEmpty()) { return target; } for (Iterator names = props.nameSet().iterator(); names.hasNext();) { target.add(names.next()); } return target; }
public void setProperties(SVNProperties properties) throws SVNException { if (properties != null) { for (Iterator names = properties.nameSet().iterator(); names.hasNext();) { String name = (String) names.next(); SVNPropertyValue value = properties.getSVNPropertyValue(name); setPropertyValue(name, value); } } }
public void changeTransactionProperties(String txnId, SVNProperties txnProperties) throws SVNException { for (Iterator iter = txnProperties.nameSet().iterator(); iter.hasNext();) { String propName = (String) iter.next(); SVNPropertyValue propValue = txnProperties.getSVNPropertyValue(propName); setTransactionProperty(txnId, propName, propValue); } }
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 void setProperties(SVNProperties properties) throws SVNException { if (properties != null) { for (Iterator names = properties.nameSet().iterator(); names.hasNext();) { String name = (String) names.next(); SVNPropertyValue value = properties.getSVNPropertyValue(name); setPropertyValue(name, value); } } }
public void changeTransactionProperties(String txnId, SVNProperties txnProperties) throws SVNException { for (Iterator iter = txnProperties.nameSet().iterator(); iter.hasNext();) { String propName = (String) iter.next(); SVNPropertyValue propValue = txnProperties.getSVNPropertyValue(propName); setTransactionProperty(txnId, propName, propValue); } }
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); } } }
protected static Map<String, byte[]> getProperties(SVNProperties svnProperties) { if (svnProperties == null) { return new HashMap<String, byte[]>(); } HashMap<String, byte[]> properties = new HashMap<String, byte[]>(); Set<String> svnPropertiesNames = svnProperties.nameSet(); for (String svnPropertyName : svnPropertiesNames) { SVNPropertyValue svnPropertyValue = svnProperties.getSVNPropertyValue(svnPropertyName); properties.put(svnPropertyName, SVNPropertyValue.getPropertyAsBytes(svnPropertyValue)); } return properties; }
public void changeTransactionProperties(String txnId, SVNProperties txnProperties) throws SVNException { for (Iterator iter = txnProperties.nameSet().iterator(); iter.hasNext();) { String propName = (String) iter.next(); SVNPropertyValue propValue = txnProperties.getSVNPropertyValue(propName); setTransactionProperty(txnId, propName, propValue); } }
private static Map<String, String> getRevisionProperties(SVNProperties revisionProperties) { if (revisionProperties == null) { return null; } HashMap<String, String> properties = new HashMap<String, String>(); Set<String> svnPropertiesNames = revisionProperties.nameSet(); for (String svnPropertyName : svnPropertiesNames) { SVNPropertyValue svnPropertyValue = revisionProperties.getSVNPropertyValue(svnPropertyName); properties.put(svnPropertyName, SVNPropertyValue.getPropertyAsString(svnPropertyValue)); } return properties; }
private boolean compareProps(SVNProperties p1, SVNProperties p2) throws SVNException { if (p1 == null || p2 == null) { return p1 == p2; } SVNProperties diff = p1.compareTo(p2); for (String propName : diff.nameSet()) { if (SVNProperty.isRegularProperty(propName) && !SVNProperty.MERGE_INFO.equals(propName)) { return false; } } return true; }
private void removeNonPropChanges(SVNProperties pristineProps, SVNProperties propChanges) { for (Iterator<String> iterator = propChanges.nameSet().iterator(); iterator.hasNext(); ) { final String propName = iterator.next(); SVNPropertyValue propertyValue = propChanges.getSVNPropertyValue(propName); if (propertyValue != null) { SVNPropertyValue oldValue = pristineProps.getSVNPropertyValue(propName); if (oldValue != null && oldValue.equals(propertyValue)) { iterator.remove(); } } } }
protected static SVNProperties omitMergeInfoChanges(SVNProperties props) { SVNProperties result = new SVNProperties(); for (String name : props.nameSet()) { if (SVNProperty.MERGE_INFO.equals(name)) { continue; } SVNPropertyValue pv = props.getSVNPropertyValue(name); result.put(name, pv); } return result; }
private List<SVNPropertyData> getPropdataList(SVNProperties properties) { final List<SVNPropertyData> propertyDataList = new ArrayList<SVNPropertyData>(); for (String name : properties.nameSet()) { final SVNPropertyData propertyData = new SVNPropertyData(name, properties.getSVNPropertyValue(name), getSVNEnvironment().getOptions()); propertyDataList.add(propertyData); } return propertyDataList; } }
public void receive(SvnTarget target, SVNProperties props) throws SVNException { for (Object propertyName : props.nameSet()) { final String name = propertyName.toString(); final SVNPropertyData propertyData = new SVNPropertyData(name, props.getSVNPropertyValue(name), getSVNEnvironment().getOptions()); if (target.isURL()) { handleProperty(target.getURL(), propertyData); } else { handleProperty(target.getFile(), propertyData); } } } });
public static void categorizeProperties(SVNProperties props, SVNProperties regular, SVNProperties entry, SVNProperties working) { for (String name : props.nameSet()) { SVNPropertyValue pv = props.getSVNPropertyValue(name); if (SVNProperty.isEntryProperty(name) && entry != null) { entry.put(name, pv); } else if (SVNProperty.isRegularProperty(name) && regular != null) { regular.put(name, pv); } else if (SVNProperty.isWorkingCopyProperty(name) && working != null) { working.put(name, pv); } } }