[PATCH] subrepos: abort commit by default if a subrepo is dirty

Jason Harris jason at jasonfharris.com
Sat Oct 22 13:29:01 CDT 2011


Is there
On Oct 21, 2011, at 3:34 AM, Angel Ezquerra wrote:

> On Fri, Oct 21, 2011 at 9:53 AM, Martin Geisler <mg at aragost.com> wrote:
>> Angel Ezquerra <angel.ezquerra at gmail.com> writes:
>> 
>>> This may be a dumb question, but will clean but modified subrepos
>>> (i.e. those were the current revision has been changed) still be
>>> committed when commitsubrepo is set to False?
>> 
>> That's actually a great question... The answer is that subrepos that
>> have changed revision *will* be committed when commitsubrepos=False.
>> 
>> I must admit that I did not expect this, but now that I think about it,
>> it seems nice: commitsubrepos=False prevents you from accidentally
>> reusing a top-level commit message in subrepos. But you're still allowed
>> to arrange the subrepos like you want (update to new versions) and then
>> make a big top-level commit to bind everything together.
>> 
>> --
>> Martin Geisler
> 
> I'm glad that is the case! In my opinion this is the right behavior.
> The new behaviour is great because it avoids modifying the subrepos
> (by creating _new_ commits, often with a nonsensical commit message)
> unless you explicitly tell mercurial to do so.
> 
> But changing the subrepo revision does not modify the subrepo itself.
> You are basically modifying the .hgsubstate file, which is part of the
> parent repo.
> 
> So in my opinion this makes a lot of sense.


Is there an option to control this? It would be really nice to turn this of in our workflow. If we could then people could still rebase in unpushed subrepo's etc, without nuking the repo by accident.

It turns out for us that most of the time changes in the super-repo and changes in the sub-repo are independent (Which should be the case as long as you are not changing the API of whatever is contained in the subrepo's.)

And so every so often we need to tie together the super-repo and sub-repo revisions. At that time it would be nice to do a special commit which updates the .hgsubstate.

(Unfortunately we didn't set things up originally with a thin wrapper super repository and all sub repositories at the main level. If we had, then of course we could have controlled the tying together by only committing the wrapper super repository whenever we needed to.)

Also is there a command to check the integrity of the repo .hgsubstate to confirm that all the subrepo revisions actually exist. Sort of like a "hg verify --subrepos" ? Ie if a user does a rebase in a subrepo and the version in .hgsubstate no longer exists then we can get a warning about it?

Thanks,
   Jas


More information about the Mercurial-devel mailing list