RFC: Transparent subrepository support by match module

Martin Geisler mg at lazybytes.net
Fri Aug 20 03:48:35 CDT 2010


Mads Kiilerich <mads at kiilerich.com> writes:

>  Martin Geisler wrote, On 08/18/2010 12:50 PM:
>
>> I just had a better idea:
>>
>> - "*" matches all characters except "/"
>> - "**" matches all characters including "/", but stops at subrepos
>> - "***" matches everything
>
> I agree that the matcher should recurse when for example commit
> recurse. I think there should be a general flag for enabling/disabling
> recursion everywhere,

Yes, this is a very good idea! We already have some commands that
recurse into subrepositories by default:

- clone
- update
- commit

The other commands do not recurse even though I think they ought to, in
particular these two:

- status
- diff

I propose we make a configuration option for this that people can enable
if they want them to recurse by default. When support for
subrepositories is complete, front-ends should be able to issue

  hg log sub/a.txt

without being told

  abort: path 'sub/b.txt' is inside repo 'sub'

and similarly for other commands -- it should in other words be
seamless. This is the behavior my client had expected and I'm pretty
sure other users expect that too. The front-ends can also run with
HGPLAIN set and so get the default non-recursive behavior.

I'm working on patches for this here:

  http://bitbucket.org/mg/subrepo-mq/

The difficult part seems to be to convince the path auditor that it's
okay to cross the repository boundaries when subrepos are involved. I'll
post a separate mail about this.

> but why do we need other and special syntax for stopping recursion at
> subrepo borders? I think it adds unneeded complexity and we don't want
> it.

Klaus presented some use cases in his mail here:

  http://mercurial.markmail.org/message/l7n2e4mmnxvh4gdo

As I see it, his use cases boils down to wanting to commit a changed
.hgsubstate file without committing changes made inside a subrepo. You
cannot do this today since the .hgsubstate file is not really modified
on disk until commit time.

I agree that adding new syntax for this may be too much. Perhaps the
imaginary --no-recurse option could solve this after all:

  $ hg status
  M sub/a.txt
  $ hg commit --no-recurse sub
  committing subrepository sub
  $ hg status
  M sub/a.txt

Meaning: only the .hgsubstate file was committed but the a.txt file is
still modified. We have no good way in 'hg status' to show that a
.hgsubstate file is (will) be modified by the next commit.

However, using 'hg summary' you can actually see that the next commit
will affect so and so many subrepositories. I'm just afraid that the
summary command is not enough here.

-- 
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/20100820/83656162/attachment.pgp>


More information about the Mercurial-devel mailing list