- if way.tags!=attributes or way.nds!=nodes or !way.visible?
- new_way = Way.new
- new_way.tags = attributes
- new_way.nds = pointlist
- new_way.changeset_id = changeset
- new_way.version = version
+ new_way = Way.new
+ new_way.tags = attributes
+ new_way.nds = pointlist
+ new_way.changeset_id = changeset
+ new_way.version = version
+ if originalway <= 0
+ new_way.create_with_history(user)
+ way=new_way # so we can get way.id and way.version
+ elsif way.tags!=attributes or way.nds!=pointlist or !way.visible?
way.update_from(new_way, user)
end
end # transaction
[0, originalway, way.id, renumberednodes, way.version, nodeversions]
rescue OSM::APIChangesetAlreadyClosedError => ex
way.update_from(new_way, user)
end
end # transaction
[0, originalway, way.id, renumberednodes, way.version, nodeversions]
rescue OSM::APIChangesetAlreadyClosedError => ex
rescue OSM::APIVersionMismatchError => ex
# Really need to check to see whether this is a server load issue, and the
# last version was in the same changeset, or belongs to the same user, then
# we can return something different
return [-3, "Sorry, someone else has changed this way since you started editing - please reload the area"]
rescue OSM::APITooManyWayNodesError => ex
rescue OSM::APIVersionMismatchError => ex
# Really need to check to see whether this is a server load issue, and the
# last version was in the same changeset, or belongs to the same user, then
# we can return something different
return [-3, "Sorry, someone else has changed this way since you started editing - please reload the area"]
rescue OSM::APITooManyWayNodesError => ex