how to give id to repo?

Christian Boos cboos at neuf.fr
Wed Mar 15 08:26:31 UTC 2006


Benoit Boissinot wrote:
> On 3/15/06, Vadim Gelfer <vadim.gelfer at gmail.com> wrote:
>   
>> for history merge changes, i want to compute id for repo that will
>> give one answer if two repos are "same".
>>
>> ...
>>
>> i think one thing i can do is just take first 16 hashes in repo, hash
>> them, call that project id. if repo has < 64 revs, say cannot compute
>> project id, just do merge without cache (will be fast then because not
>> so many revs).
>>
>> i would like ideas from other people. i want to make a project id that
>> other extensions, parts of mercurial, can use.
>>     
>
> roots revisions of the repo sound logical to use.
>   

If I'm not mistaken, root revisions can evolve over time, e.g. when you
"merge" repositories by pulling changes from an unrelated repository.

OTOH, the first 16 revs will always be the same, but you will have that
uncomfortable moment when you switch from an id-less repository to
a repository with an id. That's probably ok for the merge cache, but
other applications would want to have a repository id from day one...

Why not generate an UUID (rfc4122) at 'hg init' time?

-- Christian



More information about the Mercurial mailing list