[pergola] first and dirty implementation of track merging