add a replace branch cmd - closer to idempotency
check counts when replacing branch
check-type-counts can handle range of lines that varies

This is needed as different type views can have different numbers
of parents.