Plugin for coverage
It would be soon useful and even necessary for projects caring about coverage, including the present one, to provide exclusion rules according to Mercurial versions.
I have a preference for the style that describes the code to the one that marks an exclusion, hence I'd like it to work with this syntax:
if feature_present:
do_something() # hg>5.4
else: # hg<=5.4
do_other_thing()
coverage would then exclude the else
arm under Mercurial 5.6, for instance.
A coverage plugin with deep runtime understanding of Mercurial versions is probably too much for a first implementation.
Instead, the same kind of registration of regular expressions as coverage-python-version and coverage-pyver-pragma do would be enough, provided we are happy with a couple of simple directives: hg<X.Y
, hg<=X.Y
, hg==X.Y
, hg>=X.Y
and hg>X.Y
(one dot only, contiguous intervals only)