Should we use subrepos ourselves?

Patrick Mézard pmezard at gmail.com
Wed Aug 18 13:34:35 CDT 2010


Le 18/08/10 19:00, Brendan Cully a écrit :
> On Wednesday, 18 August 2010 at 18:49, Patrick Mézard wrote:
>>>
>>> I never modify subrepos of thg-winbuild; I'm just collecting the repos
>>> together to build installers.  And I don't want my pushes to
>>> thg-winbuild to fail if, for example, the perfarce repo is temporarily
>>> unreachable.  I also don't want my pushes to take tens of minutes if
>>> bitbucket is lagging.
>>
>> I suppose not pushing if the subrepo current revision is an ancestor of the revision in .hgsubstate or the revision itself, should be enough?
> 
> I'm a little worried that this makes assumptions about remote
> repositories. First of all, obviously this doesn't work if the subrepo
> URL changes (but I suppose we can catch this).

Ok, but assuming we are dealing with hashes here, doesn't it mean you just got a collision?

> But even if the URL
> doesn't change, you don't know if the repository it points to has
> (e.g., someone ran strip or restored from backup).

What's the worse case?

- If remote was stripped, then you would have pushed the stripped revision again. Instead we no longer automatically restore the subrepo revision and it might break (already broken?) dependencies in the remote parent repo. I would blame the one who stripped the subrepo here.
- If remote becomes unrelated, then the subrepo push would have failed anyway. If the URL was listed in .hgsub then replacing the repository broke all past .hgsub revisions. Or it was remapped and the problem is dealt with at the parent repo level. If you just introduced the subrepo and the URL was changed before you pushed it, then yes, you are pushing a broken change.

Is there anything else?

--
Patrick Mézard


More information about the Mercurial-devel mailing list