Changeset 35409 in osm for applications/editors/josm
- Timestamp:
- 2020-04-04T07:40:00+02:00 (5 years ago)
- Location:
- applications/editors/josm/plugins/reverter
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reverter/build.xml
r35226 r35409 4 4 <property name="commit.message" value="Reverter: fix deleted/redacted relation members"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 5520"/>6 <property name="plugin.main.version" value="16205"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/reverter/src/reverter/DataSetCommandMerger.java
r35407 r35409 53 53 54 54 private void addChangeCommandIfNotEquals(OsmPrimitive target, OsmPrimitive newTarget, boolean nominal) { 55 if (target.isIncomplete() !=newTarget.isIncomplete() || target.isDeleted() != newTarget.isDeleted()56 57 55 if (!target.hasEqualSemanticAttributes(newTarget) || target.isDeleted() != newTarget.isDeleted() 56 || target.isVisible() != newTarget.isVisible() 57 || !getNonDiscardableTags(target).equals(getNonDiscardableTags(newTarget))) { 58 58 cmds.add(new ChangeCommand(target, newTarget)); 59 59 if (nominal) { -
applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetCommand.java
r35407 r35409 19 19 * Create the command by specifying the list of commands to execute. 20 20 * @param name The description text 21 * @param sequenz The sequence that should beexecuted.21 * @param sequenz The sequence that was already executed. 22 22 */ 23 23 public RevertChangesetCommand(String name, Collection<Command> sequenz) { 24 24 super(name, sequenz); 25 25 ReverterPlugin.reverterUsed = true; 26 setSequenceComplete(true); 26 27 } 27 28 … … 36 37 } 37 38 39 @Override 40 public void undoCommand() { 41 getAffectedDataSet().update(super::undoCommand); 42 } 43 44 @Override 45 public boolean executeCommand() { 46 return getAffectedDataSet().update(super::executeCommand); 47 } 48 38 49 } -
applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetTask.java
r35407 r35409 15 15 16 16 import org.openstreetmap.josm.command.Command; 17 import org.openstreetmap.josm.command.SequenceCommand;18 17 import org.openstreetmap.josm.command.conflict.ConflictAddCommand; 19 18 import org.openstreetmap.josm.data.UndoRedoHandler; … … 99 98 newLayer = false; // reuse layer for subsequent reverts 100 99 } catch (OsmTransferException e) { 101 Logging.error(e); 100 if (!allcmds.isEmpty()) { 101 GuiHelper.runInEDT(() -> UndoRedoHandler.getInstance().undo(allcmds.size())); 102 } 103 Logging.error(e); 102 104 throw e; 103 105 } catch (UserCancelException e) { 106 if (!allcmds.isEmpty()) { 107 GuiHelper.runInEDT(() -> UndoRedoHandler.getInstance().undo(allcmds.size())); 108 } 104 109 Logging.warn("Revert canceled"); 105 110 Logging.trace(e); … … 108 113 } 109 114 if (!allcmds.isEmpty()) { 110 Command cmd = allcmds.size() == 1 ? allcmds.get(0) : new SequenceCommand(tr("Revert changesets"), allcmds);115 Command cmd = allcmds.size() == 1 ? allcmds.get(0) : new RevertChangesetCommand(tr("Revert changesets"), allcmds); 111 116 GuiHelper.runInEDT(() -> { 112 UndoRedoHandler.getInstance().add(cmd); 117 UndoRedoHandler.getInstance().add(cmd, false); 113 118 if (numberOfConflicts > 0) { 114 119 MainApplication.getMap().conflictDialog.warnNumNewConflicts(numberOfConflicts); … … 169 174 numberOfConflicts++; 170 175 } 176 c.executeCommand(); 171 177 } 172 178 final String desc;
Note:
See TracChangeset
for help on using the changeset viewer.