could you not have replaced git with hg above, and the argument still holds? Revlog's format itself isn't under copyright (and i doubt it exists, but only with a patent can you stop a _format_ spec from being used). If you wrote a parser for the revlog format, you aren't "infected".
Also, hg plugins are much easier to write (being in python and all), than messing around with git's internals imho (ala, facebook's modification to hg to make it massively scalable https://code.facebook.com/posts/218678814984400/scaling-merc..., which would've been almost impossible in git).