In not all upgrades, we need to change the whole store. For example, when
upgrading repository to share-safe mode, we don't touch revlogs at all hence
store cloning and copying is not required.
The store replacing code needs to be made aware about what all has changed and
hence only copy/rename those things. To kickstart that, this patch moves
existing logic into a separate function.