Changeset 30000 in osm for applications


Ignore:
Timestamp:
2013-10-06T19:08:22+02:00 (11 years ago)
Author:
donvip
Message:

[josm_reverter] fix #josm9151 - unable to revert a changeset when a way has been deleted with all its nodes

Location:
applications/editors/josm/plugins/reverter
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reverter/.classpath

    r21225 r30000  
    22<classpath>
    33        <classpathentry kind="src" path="src"/>
    4         <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
     4        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
    55        <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
    66        <classpathentry kind="output" path="build"/>
  • applications/editors/josm/plugins/reverter/src/reverter/ChangesetReverter.java

    r29561 r30000  
    99import java.util.HashSet;
    1010import java.util.Iterator;
    11 import java.util.LinkedList;
    1211import java.util.List;
    1312
     
    204203     * @throws OsmTransferException
    205204     */
     205    @SuppressWarnings("unchecked")
    206206    public void downloadObjectsHistory(ProgressMonitor progressMonitor) throws OsmTransferException {
    207207        final OsmServerMultiObjectReader rdr = new OsmServerMultiObjectReader();
     
    334334        // Create commands to restore/update all affected objects
    335335        DataSetCommandMerger merger = new DataSetCommandMerger(nds,ds);
    336         LinkedList<Command> cmds = merger.getCommandList();
     336        List<Command> cmds = merger.getCommandList();
    337337
    338338        //////////////////////////////////////////////////////////////////////////
  • applications/editors/josm/plugins/reverter/src/reverter/DataSetCommandMerger.java

    r29627 r30000  
    3131    private final DataSet targetDataSet;
    3232
    33     private final LinkedList<Command> cmds = new LinkedList<Command>();
     33    private final List<Command> cmds = new LinkedList<Command>();
     34    private final List<OsmPrimitive> undeletedPrimitives = new LinkedList<OsmPrimitive>();
    3435
    3536    /**
     
    4546        if (!target.hasEqualSemanticAttributes(newTarget)) {
    4647            cmds.add(new ChangeCommand(target,newTarget));
     48            undeletedPrimitives.add(target);
    4749        }
    4850    }
     
    9496        for (Node sourceNode : source.getNodes()) {
    9597            Node targetNode = (Node)getMergeTarget(sourceNode);
    96             if (!targetNode.isDeleted()) {
     98            if (!targetNode.isDeleted() || undeletedPrimitives.contains(targetNode)) {
    9799                newNodes.add(targetNode);
    98100            } else if (sourceNode.isIncomplete()
     
    157159    }
    158160
    159     public LinkedList<Command> getCommandList() {
     161    public List<Command> getCommandList() {
    160162        return cmds;
    161163    }
Note: See TracChangeset for help on using the changeset viewer.