Ticket #21589: 21589.patch
File 21589.patch, 2.8 KB (added by , 3 years ago) |
---|
-
src/reverter/RevertChangesetTask.java
97 97 Logging.info("Reverted changeset {0}", Long.toString(changesetId)); 98 98 newLayer = false; // reuse layer for subsequent reverts 99 99 } catch (OsmTransferException e) { 100 100 rollback(allcmds); 101 101 Logging.error(e); 102 102 throw e; 103 103 } catch (UserCancelException e) { 104 104 rollback(allcmds); 105 105 GuiHelper.executeByMainWorkerInEDT(() -> new Notification(tr("Revert was canceled")).show()); 106 106 Logging.trace(e); 107 107 return; … … 139 139 } 140 140 if (progressMonitor.isCanceled()) 141 141 throw new UserCancelException(); 142 142 int numOldConflicts = oldDataSet == null ? 0 : oldDataSet.getConflicts().size(); 143 143 // Check missing objects 144 144 rev.checkMissingCreated(); 145 145 rev.checkMissingUpdated(); … … 153 153 rev.checkMissingDeleted(); 154 154 rev.downloadMissingPrimitives(progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false)); 155 155 } 156 int numConflicts = oldDataSet == null ? 0 : oldDataSet.getConflicts().size(); 157 if (numConflicts > numOldConflicts) { 158 GuiHelper.runInEDT(() -> new Notification(tr("Please solve conflicts and maybe try again to revert.")) 159 .setIcon(JOptionPane.ERROR_MESSAGE) 160 .show()); 161 progressMonitor.cancel(); 162 } 156 163 157 164 if (progressMonitor.isCanceled()) 158 165 throw new UserCancelException(); … … 172 179 return null; 173 180 } 174 181 GuiHelper.runInEDT(() -> { 175 176 177 178 179 180 182 for (Command c : cmds) { 183 if (c instanceof ConflictAddCommand) { 184 numberOfConflicts++; 185 } 186 c.executeCommand(); 187 } 181 188 }); 182 189 final String desc; 183 190 if (revertType == RevertType.FULL) { … … 188 195 return new RevertChangesetCommand(desc, cmds); 189 196 } 190 197 191 192 198 @Override 199 protected void cancel() { 193 200 // nothing to do 194 201 } 195 202 196 197 203 @Override 204 protected void finish() { 198 205 // nothing to do 199 206 200 207 } 201 208 202 209 /** 203 210 * Return number of conflicts for this changeset.