- # Don't modify this node, make any changes you want to the new_node above
- node = Node.find(id)
- nodetags=node.tags
- nodetags.delete('created_by')
- if !fpcomp(lat, node.lat) or !fpcomp(lon, node.lon) or
- n[4] != nodetags or !node.visible?
- savenode = true
- end
- end
-
- if savenode
- new_node.changeset_id = changeset
- new_node.lat = lat
- new_node.lon = lon
- new_node.tags = n[4]
- new_node.version = version
- if id <= 0
- # We're creating the node
- new_node.create_with_history(user)
- else
- # We're updating the node (no delete here)
- node.update_from(new_node, user)
- end
-
- if id != node.id
- renumberednodes[id] = node.id
- id = node.id
- end
+ # We're updating an existing node
+ previous=Node.find(id)
+ previous.update_from(node, user)
+ nodeversions[previous.id] = previous.version