prepare for subtree merging.