Police have been attacked in Edinburgh after disorder over the previous two years.