Ticket #22520: 22520.patch

File 22520.patch, 1.1 KB (added by GerdP, 3 years ago)
  • src/reverter/ChangesetReverter.java

     
    423423        for (Iterator<ChangesetDataSetEntry> it = cds.iterator(); it.hasNext();) {
    424424            ChangesetDataSetEntry entry = it.next();
    425425            if (!checkOsmChangeEntry(entry)) continue;
     426            if (entry.getModificationType() == ChangesetModificationType.DELETED
     427                    && revertType == RevertType.SELECTION_WITH_UNDELETE) {
     428                // see #22520: missing merge target when object is first created and then
     429                // deleted in the same changeset
     430                ChangesetDataSetEntry first = cds.getFirstEntry(entry.getPrimitive().getPrimitiveId());
     431                if (first.getModificationType() == ChangesetModificationType.CREATED)
     432                    continue;
     433            }
    426434            HistoryOsmPrimitive hp = entry.getPrimitive();
    427435            OsmPrimitive dp = ds.getPrimitiveById(hp.getPrimitiveId());
    428436            if (dp == null || dp.isIncomplete()) {