Index: trunk/src/org/openstreetmap/josm/data/conflict/DeleteConflict.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/conflict/DeleteConflict.java	(revision 1563)
+++ trunk/src/org/openstreetmap/josm/data/conflict/DeleteConflict.java	(revision 1567)
@@ -22,5 +22,9 @@
     @Override public void apply(OsmPrimitive target, OsmPrimitive other) {
         target.deleted = other.deleted;
-        target.version = Math.max(target.version, other.version);
+        int newversion = Math.max(target.version, other.version);
+        // set version on "other" as well in case user decides to keep local
+        target.version = newversion;
+        other.version = newversion;
+
     }
 }
Index: trunk/src/org/openstreetmap/josm/data/conflict/PositionConflict.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/conflict/PositionConflict.java	(revision 1563)
+++ trunk/src/org/openstreetmap/josm/data/conflict/PositionConflict.java	(revision 1567)
@@ -25,5 +25,8 @@
             ((Node)target).coor = ((Node)other).coor;
             ((Node)target).eastNorth = ((Node)other).eastNorth;
-            target.version = Math.max(target.version, other.version);
+            int newversion = Math.max(target.version, other.version);
+            // set version on "other" as well in case user decides to keep local
+            target.version = newversion;
+            other.version = newversion;
         }
     }
Index: trunk/src/org/openstreetmap/josm/data/conflict/PropertyConflict.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/conflict/PropertyConflict.java	(revision 1563)
+++ trunk/src/org/openstreetmap/josm/data/conflict/PropertyConflict.java	(revision 1567)
@@ -28,5 +28,8 @@
     @Override public void apply(OsmPrimitive target, OsmPrimitive other) {
         target.put(key, other.get(key));
-        target.version = Math.max(target.version, other.version);
+        int newversion = Math.max(target.version, other.version);
+        // set version on "other" as well in case user decides to keep local
+        target.version = newversion;
+        other.version = newversion;
     }
 }
Index: trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeVisitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeVisitor.java	(revision 1563)
+++ trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeVisitor.java	(revision 1567)
@@ -217,12 +217,28 @@
 
     /**
-     * @return <code>true</code>, if no merge is needed or merge is performed already.
+     * Tries to merge a primitive <code>other</code> into an existing primitive with the same id.
+     * 
+     * @param myPrimitives the complete set of my primitives (potential merge targets) 
+     * @param myPrimitivesWithID the map of primitives (potential merge targets) with an id <> 0, for faster lookup
+     *    by id. Key is the id, value the primitive with the given value. myPrimitives.valueSet() is a 
+     *    subset of primitives.
+     * @param other  the other primitive which is to be merged with a primitive in primitives if possible
+     * @return true, if this method was able to merge <code>other</code> with an existing node; false, otherwise  
      */
     private <P extends OsmPrimitive> boolean mergeById(
-            Collection<P> primitives, HashMap<Long, P> hash, P other) {
-        // Fast-path merging of identical objects
-        if (hash.containsKey(other.id)) {
-            P my = hash.get(other.id);
-            if (my.realEqual(other, true)) {
+            Collection<P> myPrimitives, HashMap<Long, P> myPrimitivesWithID, P other) {
+        
+        // merge other into an existing primitive with the same id, if possible
+        //
+        if (myPrimitivesWithID.containsKey(other.id)) {
+            P my = myPrimitivesWithID.get(other.id);
+            if (my.realEqual(other, true /* compare semantic fields only */)) {
+                // make sure the merge target becomes the higher version number
+                // and the later timestamp
+                //
+                my.version = Math.max(other.version, my.version);
+                if (other.getTimestamp().after(my.getTimestamp())) {
+                    my.setTimestamp(other.getTimestamp());
+                }
                 merged.put(other, my);
                 return true;
@@ -230,6 +246,8 @@
         }
 
-        for (P my : primitives) {
-            if (my.realEqual(other, false)) {
+        // try to merge into one of the existing primitives 
+        //
+        for (P my : myPrimitives) {
+            if (my.realEqual(other, false /* compare all fields */)) {
                 merged.put(other, my);
                 return true; // no merge needed.
