Cloning to a downgraded repository - examples don't seem to work
Anton Shestakov
engored at gmail.com
Fri Jan 5 20:06:05 UTC 2024
03.01.2024 08:50, Chris Green пишет:
> I want to clone this repository so that I can use it with some older
> versions of mercurial that don't have share-safe, so I did:-
>
> hg --config format.share-safe=0 clone --pull .cfg .newcfg
The config option you're looking for is `format.use-share-safe`.
If you saw `format.share-safe` somewhere in the docs, then we need to
fix them.
> While I'm about it can someone explain what the --pull option does in
> the above command please.
In short, it works by using exchange protocol (so kind of like pulling
the source repo into an empty clone), as opposed to using faster cloning
methods like file copy or hardlinks. It's required for some format
conversions that change data on-disk like different compression
algorithms or storage formats (although it's probably not needed for
safe-share?).
Since hg clone --pull will repack the data during exchange even if you
didn't change any compression/storage-related options, you might indeed
see a difference in size between the source repo and the clone.
Usually I'd say the resulting clone should be smaller because of newer
storage defaults and compression tweaks, so it's normal to see an
improvement there.
Depending on your goal and curiosity you might also find `hg
debugformat` command interesting.
More information about the Mercurial
mailing list