[PATCH 1 of 2] cat: record the current behavior of wildcard matches in subrepos

Yuya Nishihara yuya at tcha.org
Mon Dec 4 09:47:11 EST 2017


On Sun, 03 Dec 2017 12:55:36 -0500, Matt Harbison wrote:
> On Sun, 03 Dec 2017 05:22:51 -0500, Yuya Nishihara <yuya at tcha.org> wrote:
> > On Sun, 26 Nov 2017 19:26:24 +0900, Yuya Nishihara wrote:
> >>   Git subrepositories only support exact file matches. Subversion
> >>   subrepositories are currently ignored.
> >
> > Oh, subrepos. "cat" is recursive by default, but "files" and friends  
> > aren't.
> > Is this a bug of "cat"?
> 
> Seems like it.  I fixed "files" in 97175d9bf7cf to not recurse by  
> default.  I think the issue here is the matcher is .always(), so the  
> subdirmatcher is also .always().  Seems like another argument for the  
> single ctx.walksub() you proposed, because there are probably several ways  
> these cmdutil functions are trying to do the same thing.

Okay, thanks. Let's add a utility function to test "m.exact(subpath) or
any(submatch.files())", not "m.visitdir(subpath)".

> This is as good a place as any to ask- when do we follow through on the  
> Subrepo Grand Plan? [1]  It seems that the long term plan was to always  
> recurse by default, and this -S stuff was a bandaid for issues resolved  
> long ago.  I wouldn't do it this cycle, given that we are have way  
> through.  There are probably a few things that might need fixing first.   
> (I'm thinking `hg serve --web-conf` doesn't know how to recurse, and I'm  
> sure there are a couple of other odd cases.)  Maybe we will want an  
> experimental flag to ease into it.
> 
> [1]  
> https://www.mercurial-scm.org/pipermail/mercurial-devel/2011-October/034816.html

The grand plan sounds like a big BC since we have 6-year history of the current
subrepo behavior.


More information about the Mercurial-devel mailing list