Changeset 14922 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2019-03-24T14:58:24+01:00 (7 years ago)
Author:
Don-vip
Message:

fix #7481 - add missing conflict when merging a primitive modified and deleted in two data sets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java

    r13497 r14922  
    318318            //
    319319        } else if (!target.isModified() && !source.isModified() && target.isVisible() != source.isVisible()
    320                 && target.getVersion() == source.getVersion())
     320                && target.getVersion() == source.getVersion()) {
    321321            // Same version, but different "visible" attribute and neither of them are modified.
    322322            // It indicates a serious problem in datasets.
     
    325325            throw new DataIntegrityProblemException(tr("Conflict in ''visible'' attribute for object of type {0} with id {1}",
    326326                    target.getType(), target.getId()));
    327         else if (target.isDeleted() && !source.isDeleted() && target.getVersion() == source.getVersion()) {
     327        } else if (target.isDeleted() && !source.isDeleted() && target.getVersion() == source.getVersion()) {
    328328            // same version, but target is deleted. Assume target takes precedence
    329329            // otherwise too many conflicts when refreshing from the server
    330             // but, if source has a referrer that is not in the target dataset there is a conflict
     330            // but, if source is modified, there is a conflict
     331            if (source.isModified()) {
     332                addConflict(new Conflict<>(target, source, true));
     333            }
     334            // or, if source has a referrer that is not in the target dataset there is a conflict
    331335            // If target dataset refers to the deleted primitive, conflict will be added in fixReferences method
    332336            for (OsmPrimitive referrer: source.getReferrers()) {
Note: See TracChangeset for help on using the changeset viewer.