subrepo grand plan

Martin Geisler mg at lazybytes.net
Wed Oct 19 14:09:37 CDT 2011


Matt Mackall <mpm at selenic.com> writes:

> On Wed, 2011-10-19 at 09:42 +0000, David.Sedlock at lantiq.com wrote:
>
>> commitsubrepos.
>>
>> This is the option we wanted Martin to use so we could get consistent
>> behavior of commit/status/diff.
>>
>> The existence of this option cannot be consistent with your statement
>> "We absolutely cannot have a naked 'hg commit' commit everything but
>> subrepos."
>
> You haven't been listening carefully enough. There are THREE choices:
>
> 1) the current default behavior
>    'a naked commit ... recurses'
> 2) Patrick's commitsubrepos=False behavior
>    'a naked commit ... aborts if subrepos are modified'
> 3) the thing that everyone asks for (commit only the main repo)
>    'a naked commit ... commits everything but subrepos'

I just realized that there might have been some confusion here!

The option I proposed is like *option 2*, not option 3. In other words,
it does not allow you to commit the main repo alone. The recursesubrepos
does two things:

1) it sets  commitsubrepos = recursesubrepos for commit
2) it sets opts['subrepos'] = recursesubrepos for status and diff

That's all -- the goal is to let the user set recursesubrepos=False and
get consistency between the commands as in this table:

  If ui.recursesubrepos is set to a boolean B, then we have:

            | recurses   | recurses
            | by default | with --subrepos
    --------+------------+----------------
    commit: | B          | True
    status: | B          | True
    diff:   | B          | True

The --subrepos flag is new for commit, it lets the user override the
recursesubrepos option on the command line when needed.

I'm sorry if my explanation was confusing in the original patch:

  http://selenic.com/pipermail/mercurial-devel/2011-September/034354.html

-- 
Martin Geisler

Mercurial links: http://mercurial.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20111019/70b5ada8/attachment.pgp>


More information about the Mercurial-devel mailing list