.hg folder contains no store folder.

Adrian Buehlmann adrian at cadifra.com
Mon Sep 3 06:49:28 CDT 2012


On 2012-09-03 11:11, Pierre-Yves David wrote:
> On Fri, Aug 31, 2012 at 01:47:17PM -0500, Augie Fackler wrote:
>> (switching to devel)
>>
>> On Aug 31, 2012, at 7:03 AM, Adrian Buehlmann wrote:
>>
>>> This story seems to match with a repository having Mercurial's very first
>>> repository format.
>>>
>>> Just creating an empty ".hg" directory (instead of using 'hg init' or 'hg
>>> clone') leaves a valid Mercurial repository.
>>
>> Interesting. I wonder if we could treat a completely empty .hg folder as a
>> totally new repo when we do a commit, so it doesn't create repositories in
>> this ancient layout?

Might be doable. Question is, whether this rather rare use case is
really worth bothering.

But it's certainly very likely pretty unwanted if people end having a
repo in this rusty format.

> Won't that break the purpose of an "hg init --config format.usestore=False" ?

When I do that with a current Mercurial, it creates a ".hg" directory
with a "requires" file containing "revlogv1".

If someone oddly enough would want to insist on having a repo in the
very first format *and* keep it in that format when using it with
current Mercurial, then he could manually create a ".hg" directory with
an empty "requires" file.

The presence of the requires file would then be sufficient to disable
Augie's "on the fly" creation-magic of a current repo. We check for the
requires file anyway, so there would be no speed penalty.

If there is no requires file, the new logic would have to see if the .hg
dir is empty. If it isn't empty, it could possibly additionally create
an empty requires file on the fly on write operations (e.g. on commit or
push).


More information about the Mercurial-devel mailing list