repo tosort reorg