> On 12/21/2016 10:47 PM, David Soria Parra wrote:
> >
> >
> >> -----Original Message-----
> >> From: Pierre-Yves David [mailto:pierre-yves.da...@ens-lyon.org]
> >>
> >> I would prefer to have that exclusion logic in 'test-check-commit.t',
> >> These commit still fails our commit checks, but we skip them from
> >> automated testing.
> >>
> >> Just add "and not desc('#no-check-commit')" to the revset there
> >
> > Seems reasonable, note however it changes the behavior as `# no-check-
> commit`
> > can appear anywhere when using `desc()` while my implementation
> searches for it
> > at the starting of a line.
> 
> The regex to feed 'desc()' with in order to mark start of line only is
> left as an exercise with the reader ;-)

Please read the code before making bold statements:

From hg help revsets
    "desc(string)"
      Search commit message for string. The match is case-insensitive.

Note "string" not pattern. If we look into the implementation:

  @predicate('desc(string)', safe=True)
  def desc(repo, subset, x):
      # ...
      def matches(x):
          c = repo[x]
          return ds in encoding.lower(c.description())

note `ds in encoding.lower(c.description())`. Maybe my Python is not as strong 
as yours but last time
I checked this does not support regex unless I am mistaken.

I leave it to the reviewer to decide if we are taking the v1 with proper regex 
matching on multiline or settle
with desc() which does not support patterns.

-D
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to