private static boolean equals(SVNPropertyValue oldValue, SVNPropertyValue newValue) { if (oldValue == null || newValue == null) { return oldValue == newValue; } return oldValue.equals(newValue); }
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } SVNPropertyData other = (SVNPropertyData) obj; if (myName == null) { if (other.myName != null) { return false; } } else if (!myName.equals(other.myName)) { return false; } if (myValue == null) { if (other.myValue != null) { return false; } } else if (!myValue.equals(other.myValue)) { return false; } return true; }
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } SVNPropertyData other = (SVNPropertyData) obj; if (myName == null) { if (other.myName != null) { return false; } } else if (!myName.equals(other.myName)) { return false; } if (myValue == null) { if (other.myValue != null) { return false; } } else if (!myValue.equals(other.myValue)) { 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(); } } } }
private SVNProperties removeNonPropChanges(SVNProperties pristineProps, SVNProperties changes) { SVNProperties newChanges = new SVNProperties(); for (Iterator<Map.Entry<String, SVNPropertyValue>> iterator = changes.asMap().entrySet().iterator(); iterator.hasNext(); ) { final Map.Entry<String, SVNPropertyValue> entry = iterator.next(); String name = entry.getKey(); SVNPropertyValue value = entry.getValue(); boolean remove = false; if (value != null) { SVNPropertyValue oldValue = pristineProps.getSVNPropertyValue(name); if (oldValue != null && oldValue.equals(value)) { remove = true; } } if (!remove) { newChanges.put(name, value); } } return newChanges; }
private void removeNonPropChanges(SVNProperties pristineProps, SVNProperties propChanges) { Set<String> removed = new HashSet<String>(); for (String propertyName : propChanges.nameSet()) { SVNPropertyValue newValue = propChanges.getSVNPropertyValue(propertyName); if (newValue != null) { SVNPropertyValue oldValue = pristineProps.getSVNPropertyValue(propertyName); if (oldValue != null && oldValue.equals(newValue)) { removed.add(propertyName); } } } for (String name : removed) { propChanges.remove(name); } }
private MergePropStatusInfo applySingleGenericPropChange(SVNStatusType state, File localAbspath, SVNConflictVersion leftVersion, SVNConflictVersion rightVersion, boolean isDir, SVNProperties workingProps, String propname, SVNPropertyValue baseVal, SVNPropertyValue oldVal, SVNPropertyValue newVal, ISVNConflictHandler conflictResolver, boolean dryRun) throws SVNException { assert (oldVal != null); boolean conflictRemains = false; SVNPropertyValue workingVal = workingProps.getSVNPropertyValue(propname); if (workingVal != null && oldVal != null && workingVal.equals(oldVal)) { workingProps.put(propname, newVal); } else { conflictRemains = conflictResolver == null ? true : maybeGeneratePropConflict(localAbspath, leftVersion, rightVersion, isDir, propname, workingProps, oldVal, newVal, baseVal, workingVal, conflictResolver, dryRun); } return new MergePropStatusInfo(state, conflictRemains); }
MergePropStatusInfo applySinglePropDelete(SVNStatusType state, File localAbspath, SVNConflictVersion leftVersion, SVNConflictVersion rightVersion, boolean isDir, SVNProperties workingProps, String propname, SVNPropertyValue baseVal, SVNPropertyValue oldVal, ISVNConflictHandler conflictResolver, boolean dryRun) throws SVNException { boolean conflictRemains = false; SVNPropertyValue workingVal = workingProps.getSVNPropertyValue(propname); if (baseVal == null) { if (workingVal != null && !workingVal.equals(oldVal)) { conflictRemains = maybeGeneratePropConflict(localAbspath, leftVersion, rightVersion, isDir, propname, workingProps, oldVal, null, baseVal, workingVal, conflictResolver, dryRun); } else { workingProps.remove(propname); if (oldVal != null) { state = setPropMergeState(state, SVNStatusType.MERGED); } } } else if (baseVal.equals(oldVal)) { if (workingVal != null) { if (workingVal.equals(oldVal)) { workingProps.remove(propname); } else { conflictRemains = maybeGeneratePropConflict(localAbspath, leftVersion, rightVersion, isDir, propname, workingProps, oldVal, null, baseVal, workingVal, conflictResolver, dryRun); } } else { state = setPropMergeState(state, SVNStatusType.MERGED); } } else { conflictRemains = maybeGeneratePropConflict(localAbspath, leftVersion, rightVersion, isDir, propname, workingProps, oldVal, null, baseVal, workingVal, conflictResolver, dryRun); } return new MergePropStatusInfo(state, conflictRemains); }
private static SVNProperties computePropsDiff(SVNProperties props1, SVNProperties props2) { SVNProperties propsDiff = new SVNProperties(); for (Iterator names = props2.nameSet().iterator(); names.hasNext();) { String newPropName = (String) names.next(); if (props1.containsName(newPropName)) { // changed. SVNPropertyValue oldValue = props2.getSVNPropertyValue(newPropName); if (!oldValue.equals(props1.getSVNPropertyValue(newPropName))) { propsDiff.put(newPropName, props2.getSVNPropertyValue(newPropName)); } } else { // added. propsDiff.put(newPropName, props2.getSVNPropertyValue(newPropName)); } } for (Iterator names = props1.nameSet().iterator(); names.hasNext();) { String oldPropName = (String) names.next(); if (!props2.containsName(oldPropName)) { // deleted propsDiff.put(oldPropName, (SVNPropertyValue) null); } } return propsDiff; }
private static SVNProperties computePropsDiff(SVNProperties props1, SVNProperties props2) { SVNProperties propsDiff = new SVNProperties(); for (Iterator names = props2.nameSet().iterator(); names.hasNext();) { String newPropName = (String) names.next(); if (props1.containsName(newPropName)) { // changed. SVNPropertyValue oldValue = props2.getSVNPropertyValue(newPropName); SVNPropertyValue value = props1.getSVNPropertyValue(newPropName); if (oldValue != null && !oldValue.equals(value)) { propsDiff.put(newPropName, oldValue); } else if (oldValue == null && value != null) { propsDiff.put(newPropName, oldValue); } } else { // added. propsDiff.put(newPropName, props2.getSVNPropertyValue(newPropName)); } } for (Iterator names = props1.nameSet().iterator(); names.hasNext();) { String oldPropName = (String) names.next(); if (!props2.containsName(oldPropName)) { // deleted propsDiff.put(oldPropName, (String) null); } } return propsDiff; }
private static SVNProperties computePropsDiff(SVNProperties props1, SVNProperties props2) { SVNProperties propsDiff = new SVNProperties(); for (Iterator names = props2.nameSet().iterator(); names.hasNext();) { String newPropName = (String) names.next(); if (props1.containsName(newPropName)) { // changed. SVNPropertyValue oldValue = props2.getSVNPropertyValue(newPropName); if (!oldValue.equals(props1.getSVNPropertyValue(newPropName))) { propsDiff.put(newPropName, props2.getSVNPropertyValue(newPropName)); } } else { // added. propsDiff.put(newPropName, props2.getSVNPropertyValue(newPropName)); } } for (Iterator names = props1.nameSet().iterator(); names.hasNext();) { String oldPropName = (String) names.next(); if (!props2.containsName(oldPropName)) { // deleted propsDiff.put(oldPropName, (SVNPropertyValue) null); } } return propsDiff; }
private static SVNProperties computePropsDiff(SVNProperties props1, SVNProperties props2) { SVNProperties propsDiff = new SVNProperties(); for (Iterator names = props2.nameSet().iterator(); names.hasNext();) { String newPropName = (String) names.next(); if (props1.containsName(newPropName)) { // changed. SVNPropertyValue oldValue = props2.getSVNPropertyValue(newPropName); if (!oldValue.equals(props1.getSVNPropertyValue(newPropName))) { propsDiff.put(newPropName, props2.getSVNPropertyValue(newPropName)); } } else { // added. propsDiff.put(newPropName, props2.getSVNPropertyValue(newPropName)); } } for (Iterator names = props1.nameSet().iterator(); names.hasNext();) { String oldPropName = (String) names.next(); if (!props2.containsName(oldPropName)) { // deleted propsDiff.put(oldPropName, (SVNPropertyValue) null); } } return propsDiff; }
private static SVNProperties computePropsDiff(SVNProperties props1, SVNProperties props2) { SVNProperties propsDiff = new SVNProperties(); for (Iterator names = props2.nameSet().iterator(); names.hasNext();) { String newPropName = (String) names.next(); if (props1.containsName(newPropName)) { // changed. SVNPropertyValue oldValue = props2.getSVNPropertyValue(newPropName); SVNPropertyValue value = props1.getSVNPropertyValue(newPropName); if (oldValue != null && !oldValue.equals(value)) { propsDiff.put(newPropName, oldValue); } else if (oldValue == null && value != null) { propsDiff.put(newPropName, oldValue); } } else { // added. propsDiff.put(newPropName, props2.getSVNPropertyValue(newPropName)); } } for (Iterator names = props1.nameSet().iterator(); names.hasNext();) { String oldPropName = (String) names.next(); if (!props2.containsName(oldPropName)) { // deleted propsDiff.put(oldPropName, (String) null); } } return propsDiff; }
} else if (!targetPropVal.equals(srcPropVal)) { result.put(propName, targetPropVal);
} else if (!targetPropVal.equals(srcPropVal)) { result.put(propName, targetPropVal);
private static SVNProperties computePropsDiff(SVNProperties props1, SVNProperties props2) { SVNProperties propsDiff = new SVNProperties(); for (Iterator names = props2.nameSet().iterator(); names.hasNext();) { String newPropName = (String) names.next(); if (props1.containsName(newPropName)) { // changed. SVNPropertyValue oldValue = props2.getSVNPropertyValue(newPropName); SVNPropertyValue value = props1.getSVNPropertyValue(newPropName); if (oldValue != null && !oldValue.equals(value)) { propsDiff.put(newPropName, oldValue); } else if (oldValue == null && value != null) { propsDiff.put(newPropName, oldValue); } } else { // added. propsDiff.put(newPropName, props2.getSVNPropertyValue(newPropName)); } } for (Iterator names = props1.nameSet().iterator(); names.hasNext();) { String oldPropName = (String) names.next(); if (!props2.containsName(oldPropName)) { // deleted propsDiff.put(oldPropName, (String) null); } } return propsDiff; }
private static SVNProperties computePropsDiff(SVNProperties props1, SVNProperties props2) { SVNProperties propsDiff = new SVNProperties(); for (Iterator names = props2.nameSet().iterator(); names.hasNext();) { String newPropName = (String) names.next(); if (props1.containsName(newPropName)) { // changed. SVNPropertyValue oldValue = props2.getSVNPropertyValue(newPropName); SVNPropertyValue value = props1.getSVNPropertyValue(newPropName); if (oldValue != null && !oldValue.equals(value)) { propsDiff.put(newPropName, oldValue); } else if (oldValue == null && value != null) { propsDiff.put(newPropName, oldValue); } } else { // added. propsDiff.put(newPropName, props2.getSVNPropertyValue(newPropName)); } } for (Iterator names = props1.nameSet().iterator(); names.hasNext();) { String oldPropName = (String) names.next(); if (!props2.containsName(oldPropName)) { // deleted propsDiff.put(oldPropName, (String) null); } } return propsDiff; }
public static boolean setWCProperty(SVNWCAccess access, File path, String propName, SVNPropertyValue propValue, boolean write) throws SVNException { SVNEntry entry = access.getVersionedEntry(path, false); SVNAdminArea dir = entry.getKind() == SVNNodeKind.DIR ? access.retrieve(path) : access.retrieve(path.getParentFile()); SVNVersionedProperties wcProps = dir.getWCProperties(entry.getName()); SVNPropertyValue oldValue = wcProps.getPropertyValue(propName); wcProps.setPropertyValue(propName, propValue); if (write) { dir.saveWCProperties(false); } return oldValue == null ? propValue != null : !oldValue.equals(propValue); }
public static boolean setWCProperty(SVNWCAccess access, File path, String propName, SVNPropertyValue propValue, boolean write) throws SVNException { SVNEntry entry = access.getVersionedEntry(path, false); SVNAdminArea dir = entry.getKind() == SVNNodeKind.DIR ? access.retrieve(path) : access.retrieve(path.getParentFile()); SVNVersionedProperties wcProps = dir.getWCProperties(entry.getName()); SVNPropertyValue oldValue = wcProps.getPropertyValue(propName); wcProps.setPropertyValue(propName, propValue); if (write) { dir.saveWCProperties(false); } return oldValue == null ? propValue != null : !oldValue.equals(propValue); }
public static boolean setWCProperty(SVNWCAccess access, File path, String propName, SVNPropertyValue propValue, boolean write) throws SVNException { SVNEntry entry = access.getVersionedEntry(path, false); SVNAdminArea dir = entry.getKind() == SVNNodeKind.DIR ? access.retrieve(path) : access.retrieve(path.getParentFile()); SVNVersionedProperties wcProps = dir.getWCProperties(entry.getName()); SVNPropertyValue oldValue = wcProps.getPropertyValue(propName); wcProps.setPropertyValue(propName, propValue); if (write) { dir.saveWCProperties(false); } return oldValue == null ? propValue != null : !oldValue.equals(propValue); }