AG Barr and Britvic have agreed on the details of an all-share merger, which will create one of Europe's largest soft drinks makers.