Index: /applications/editors/josm/plugins/reverter/src/reverter/DataSetCommandMerger.java
===================================================================
--- /applications/editors/josm/plugins/reverter/src/reverter/DataSetCommandMerger.java	(revision 34921)
+++ /applications/editors/josm/plugins/reverter/src/reverter/DataSetCommandMerger.java	(revision 34922)
@@ -97,5 +97,5 @@
      *
      */
-    private void mergeWay(Way source) throws IllegalStateException {
+    private void mergeWay(Way source) {
         if (source.isIncomplete()) return;
         if (!source.isVisible()) return;
@@ -143,5 +143,5 @@
      * members in source
      */
-    private void mergeRelation(Relation source) throws IllegalStateException {
+    private void mergeRelation(Relation source) {
         if (source.isIncomplete()) return;
         if (!source.isVisible()) return;
@@ -178,6 +178,15 @@
             mergeWay(way);
         }
+        // first handle those relations which don't refer to other relations
         for (Relation relation: sourceDataSet.getRelations()) {
-            mergeRelation(relation);
+            if (relation.getMemberPrimitives(Relation.class).isEmpty()) {
+                mergeRelation(relation);
+            }
+        }
+        // now the rest of the relations.
+        for (Relation relation: sourceDataSet.getRelations()) {
+            if (!relation.getMemberPrimitives(Relation.class).isEmpty()) {
+                mergeRelation(relation);
+            }
         }
     }
