[PATCH 2 of 2 sparse-ext maybe-for-stable] sparse: treat paths as cwd-relative

Kostia Balytskyi ikostia at fb.com
Fri Jul 28 09:47:50 EDT 2017


> -----Original Message-----
> From: Martin von Zweigbergk [mailto:martinvonz at google.com]
> Sent: Thursday, 27 July, 2017 00:28
> To: Kostia Balytskyi <ikostia at fb.com>
> Cc: Mercurial-devel <mercurial-devel at mercurial-scm.org>
> Subject: Re: [PATCH 2 of 2 sparse-ext maybe-for-stable] sparse: treat paths
> as cwd-relative
> 
> On Wed, Jul 26, 2017 at 4:11 PM, Kostia Balytskyi <ikostia at fb.com> wrote:
> > # HG changeset patch
> > # User Kostia Balytskyi <ikostia at fb.com> # Date 1501110087 25200
> > #      Wed Jul 26 16:01:27 2017 -0700
> > # Branch stable
> > # Node ID 6bc64227f84e6a17aa1f8e71916915644531a04e
> > # Parent  681f8819475ed5546e712d9ce04116b8b5a04f9b
> > sparse: treat paths as cwd-relative
> 
> No tests?
> 
> > diff --git a/mercurial/sparse.py b/mercurial/sparse.py
> > --- a/mercurial/sparse.py
> > +++ b/mercurial/sparse.py
> > @@ -639,6 +639,10 @@ def updateconfig(repo, pats, opts, inclu
> >          if any(os.path.isabs(pat) for pat in pats):
> >              raise error.Abort(_('paths cannot be absolute'))
> >
> > +        if not usereporootpaths:
> > +            # let's treat paths as relative to cwd
> > +            pats = scmutil.match(repo['.'], pats).files()
> 
> This looks suspicious to me. Can pats contain patterns here? If
> pats=['glob:**/*.py'], what will the new pats be?

I do not think I understand the question about globs, but I added a glob to the test in the next version of this patch in case it removes some of your concerns.


More information about the Mercurial-devel mailing list