D7649: match: make sure `root` argument is always an absolute path

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Fri Dec 20 07:16:13 EST 2019


pulkit added a comment.


  I am bit confused with `/repo` everywhere that whether that's the only valid or other forms can be valid also. I will prefer making existing root passed as absolute instead of replacing them with `/repo` (provided I understood correctly). Also I am not sure, but does this counts as API change?

INLINE COMMENTS

> match.py:186
>      Usually a patternmatcher is returned:
> -    >>> match(b'foo', b'.', [b're:.*\.c$', b'path:foo/a', b'*.py'])
> +    >>> match(b'/repo', b'.', [b're:.*\.c$', b'path:foo/a', b'*.py'])
>      <patternmatcher patterns='.*\\.c$|foo/a(?:/|$)|[^/]*\\.py$'>

Hm, does this has to be always `/repo` or `/foo` is also a valid parameter here?

> test-match.py:69
>      def testVisitdirPrefix(self):
> -        m = matchmod.match(b'x', b'', patterns=[b'path:dir/subdir'])
> +        m = matchmod.match(b'/repo', b'', patterns=[b'path:dir/subdir'])
>          assert isinstance(m, matchmod.patternmatcher)

This and below ones can be `/x` too right?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7649/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7649

To: martinvonz, #hg-reviewers, mharbison72
Cc: pulkit, mharbison72, mercurial-devel


More information about the Mercurial-devel mailing list