D5785: blackbox: take regex patterns for blackbox.track

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Fri Feb 1 08:19:58 EST 2019


yuja added a comment.


  > +        track = ui.configlist('blackbox', 'track')
  >  +        if not track:
  >  +            self._active = False
  >  +        elif b'*' in track:
  >  +            self._trackedevents = re.compile(b'.*')
  >  +        else:
  >  +            try:
  >  +                self._trackedevents = re.compile(b'|'.join(track))
  >  +            except re.error as e:
  >  +                ui.warn('invalid blackbox.track setting: %s\n' % e)
  >  +                self._active = False
  
  Can't we process the pattern as a glob? It's compatible with `*` and much
  easier to write. Or do you need the power of the regexp?

REPOSITORY
  rHG Mercurial

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

To: spectral, #hg-reviewers
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list