Non recursive update with subrepo's

Angel Ezquerra angel.ezquerra at gmail.com
Thu Jan 30 10:57:15 UTC 2014


On Thu, Jan 30, 2014 at 11:50 AM, Raphael Sebbe <raphael.sebbe at gmail.com> wrote:
> That's actually the default behavior: "hg update" on parent also updates subrepos to their recorded versions. This is well documented, and works as expected. Having an example of that wouldn't bring interesting information IMO.
>
> This is the right way of restoring a parent repository with all its subrepo to a given state. No problem on that. That's the "Restore" scenario.
>
> My argument here is that there is another scenario, let call it "Daily Development", in which developers work on each repo and want to handle themselves the versions of each repo/subrepo (full control). However, in that use-case, whenever the parent repository is pulled/updated, it also updates the subrepo, which is cumbersome because developers have to go through each of the subrepo to update them back to the tip. That "Daily Development" scenario of not updating subrepo when updating parent repo is not possible at all in Mercurial (couldn't find options for it), yet it's the most common one for us.
>
> Don't misunderstand me, the "Restore" scenario is useful and should be preserved of course. But I think an option that would allow updating parent repository without updating subrepo would be an interesting option to have for daily development work.
>
> Is my description more clear that way?
>
> Best,
>
> Raphael

You should have a look at Martin Geisler's onsub extension
(http://mercurial.selenic.com/wiki/OnsubExtension). It is bundled with
TortoiseHg (and I think it would be useful to bundle it with mercurial
core too). It lets you run commands on all your subrepos. For example
you can do:

    hg onsub update

And all your subrepos will be updated to the head of the default branch.

BTW, we usually bottom post on this mailing list.

Cheers,

Angel



More information about the Mercurial mailing list