[PATCH] match: adding non-recursive directory matching

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Tue Nov 15 08:46:32 EST 2016


At Mon, 7 Nov 2016 14:38:00 -0800,
Martin von Zweigbergk wrote:
> 
> On Wed, Oct 26, 2016 at 2:03 PM Rodrigo Damazio via Mercurial-devel <
> mercurial-devel at mercurial-scm.org> wrote:
> 
> > On Wed, Oct 26, 2016 at 12:17 AM, FUJIWARA Katsunori <
> > foozy at lares.dti.ne.jp> wrote:
> >
> >
> > At Tue, 25 Oct 2016 19:51:59 -0700,
> > Rodrigo Damazio wrote:
> > >
> > > On Tue, Oct 25, 2016 at 4:31 PM, FUJIWARA Katsunori <
> > foozy at lares.dti.ne.jp>
> > > wrote:
> > >
> > > >
> > > > At Mon, 24 Oct 2016 10:34:52 -0700,
> > > > Rodrigo Damazio wrote:
> > > > >

[snip]

> > > > > On Mon, Oct 24, 2016 at 6:21 AM, Pierre-Yves David <
> > > > > pierre-yves.david at ens-lyon.org> wrote:
> > > > >
> > > > > >
> > > > > > On 10/21/2016 05:13 PM, FUJIWARA Katsunori wrote:
> > > > > >

[snip]

> > > > > >> FYI, current pattern matching is implemented as below. This was
> > > > > >> chatted in "non-recursive directory matching" session of 4.0 sprint,
> > > > > >> and sorry for my late posting of this translation from
> > > > > >> http://d.hatena.ne.jp/flying-foozy/20140107/1389087728 in Japanese, as
> > > > > >> my backlog of the last sprint.
> > > > > >>
> > > > > >>   ============ ======= ======= ===========
> > > > > >>   pattern type root-ed cwd-ed  any-of-path
> > > > > >>   ============ ======= ======= ===========
> > > > > >>   wildcard     ---     glob    relglob
> > > > > >>   regexp       re      ---     relre
> > > > > >>   raw string   path    relpath ---
> > > > > >>   ============ ======= ======= ===========
> > > > > >>
> > > > > >>   If rule is read in from file (e.g. .hgignore):
> > > > > >>
> > > > > >>     * "glob" is treated as "relglob"
> > > > > >>     * "re" is treated as "relre"
> > > > > >>
> > > > > >>   This is mentioned in "hg help patterns" and "hg help hgignore", but
> > > > > >>   syntax name "relglob" and "relre" themselves aren't explained.
> > > > > >>
> > > > > >>   "end of name" matching is required:
> > > > > >>
> > > > > >>     * for glob/relglob as PATTERN (e.g. argument in command line), but
> > > > > >>     * not for glob/relglob as INCLUDES/EXCLUDES, or other pattern syntaxes
> > > > > >>
> > > > > >>   For example, file "foo/bar/baz" is:
> > > > > >>
> > > > > >>     * not matched at "hg files glob:foo/bar"
> > > > > >>     * but matched at "hg file -I glob:foo/bar"
> > > > > >>
> > > > > >>   This isn't mentioned in any help document :-<, and the latter seems
> > > > > >>   to cause the issue mentioned in this patch series.
> >
> >
> `hg help patterns` actually has the following section that I suspect is
> meant to say this, although it definitely could have been made clearer:
> 
>     All patterns, except for "glob:" specified in command line (not for "-I"
>     or "-X" options), can match also against directories: files under
> matched
>     directories are treated as matched.

Oops, I forgot my own patch to add this explanation, which was posted
after writing my blog entry described above :-<

    https://www.mercurial-scm.org/repo/hg/rev/50db996bccaf

----------------------------------------------------------------------
[FUJIWARA Katsunori]                             foozy at lares.dti.ne.jp


More information about the Mercurial-devel mailing list