Copy a branch between trees

Suppose I have two syncronized trees A and B in different files. B is friend of A, but I want to break the friendship, so I want to copy on branch from B to A. Is there an easy way without looping over all the events?