Cloning to a downgraded repository - examples don't seem to work

Chris Green cl at isbd.net
Sat Jan 6 10:16:29 UTC 2024


On Fri, Jan 05, 2024 at 05:06:05PM -0300, Anton Shestakov wrote:
> 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`.
> 
Oh, OK, thank you.  How would I deduce that from the help at
https://wiki.mercurial-scm.org/MissingRequirement ?

It lists the requirements and there's "dotencode" from the sample
given and there's "share-safe".  How would I deduce that I have to put
"use-" on the front of "share-safe"?  Unless, of course, the example
is wrong and it should have "format.use-dotencode".


> 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.
> 
Yes, but it was much smaller when I **didn't** use the --pull.

When I used --pull the clone was just about the same size as the
original, without the --pull it was about a quarter of the size (6Mb
instead of 24Mb if I remember right).

> 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.

Thanks! :-)

-- 
Chris Green


More information about the Mercurial mailing list