This is an archive of the discontinued Mercurial Phabricator instance.

blackbox: take regex patterns for blackbox.track
AbandonedPublic

Authored by spectral on Jan 31 2019, 5:07 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

spectral created this revision.Jan 31 2019, 5:07 PM
spectral updated this revision to Diff 13658.Jan 31 2019, 5:23 PM
yuja added a subscriber: yuja.Feb 1 2019, 8:19 AM

+ 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?

spectral planned changes to this revision.Feb 4 2019, 3:42 PM
In D5785#84935, @yuja wrote:

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?

I generally prefer regex, but I might be an outlier. We do not need the power of regexp, especially if we get a negative filter (next commit), so I'll do that (eventually). Marking as "plan changes" for now...

spectral abandoned this revision.Aug 26 2019, 1:19 PM

https://www.mercurial-scm.org/repo/hg/rev/56132ebd14c6 Added blackbox.ignore, which is probably sufficient.