Thanks for looking into this! Can you prepare a pull request to make this easier
to review?
Jendrik, can you test if the new uncrustify.py works for you?
You can see the clean way to provide a fallback in the try/except block at the
top of the file. I would try to import the "command" decorator, and if it is not
present, implement a do-nothing decorator with something like:
def command(*args, **kwargs):
def identity_decorator(f):
return f
return identity_decorator
(I can provide more details with a pull request.)
Having said that, we don't necessarily have to bother with supporting Mercurial
1.9 or older. hg uncrustify is only an internal tool, and Mercurial 2.0 was
released in 2011. Our oldest software versions are usually the ones on the
sciCORE grid, and on the new login node the default version of Mercurial is 2.6
(from 2013). On aidev, which needs hg for the build master, we have Mercurial
2.8. Not sure about the build slaves, but if they cause problems, we will find
it out.
If you do want to test an older version, they are available on
https://www.mercurial-scm.org/release/?M=D
|