Changeset 34036 in osm for applications/editors


Ignore:
Timestamp:
2018-01-28T20:57:36+01:00 (7 years ago)
Author:
donvip
Message:

fix #josm15843, #josm15844 - problem with changesets already reverted

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetTask.java

    r34028 r34036  
    1010import java.util.List;
    1111import java.util.concurrent.Callable;
     12import java.util.stream.Collectors;
    1213
    1314import javax.swing.JOptionPane;
     
    8788        numberOfConflicts = 0;
    8889        final List<Command> allcmds = new ArrayList<>();
    89         Logging.info("Reverting {0} changeset(s): {1}", changesetIds.size(), changesetIds);
     90        Logging.info("Reverting {0} changeset(s): {1}",
     91                changesetIds.size(), changesetIds.stream().map(Long::toString).collect(Collectors.toList()));
    9092        for (int changesetId : changesetIds) {
    9193            try {
    92                 Logging.info("Reverting changeset {0}", changesetId);
    93                 allcmds.add(revertChangeset(changesetId));
    94                 Logging.info("Reverted changeset {0}", changesetId);
     94                Logging.info("Reverting changeset {0}", Long.toString(changesetId));
     95                RevertChangesetCommand cmd = revertChangeset(changesetId);
     96                if (cmd != null) {
     97                    allcmds.add(cmd);
     98                }
     99                Logging.info("Reverted changeset {0}", Long.toString(changesetId));
    95100                newLayer = false; // reuse layer for subsequent reverts
    96101            } catch (OsmTransferException e) {
     
    154159        List<Command> cmds = rev.getCommands();
    155160        if (cmds.isEmpty()) {
    156             String msg = MessageFormat.format("No revert commands found for changeset {0}", changesetId);
    157             Logging.warn(msg);
    158             throw new OsmTransferException(msg);
     161            Logging.warn(MessageFormat.format("No revert commands found for changeset {0}", Long.toString(changesetId)));
     162            return null;
    159163        }
    160164        for (Command c : cmds) {
Note: See TracChangeset for help on using the changeset viewer.