Extending Mercurial
After releasing Sphinx 0.5 and Pygments 1.0 yesterday, I had to relax somewhat, so I wrote something I've always missed: both for Python and my projects, many commits get an entry in the project's changelog file, so I end up writing the log message twice: once into the changelog, once as the commit message.
Since I've been playing around with Mercurial and its extensions, I did it as a new extension that wraps around the commit command: it looks if a new changelog entry is in the committed changes, and in that case lets the commit message default to this entry.
It has been really easy to implement this. Mercurial code is very clean and concise, and the API doesn't require you to call five methods on seven different instances just to get at a diff of changes.
The code is, of course, in a repo. It doesn't work with hg 1.0 because I'm too lazy to rewrite the nice command wrapping helper they added in the trunk :)
Since I've been playing around with Mercurial and its extensions, I did it as a new extension that wraps around the commit command: it looks if a new changelog entry is in the committed changes, and in that case lets the commit message default to this entry.
It has been really easy to implement this. Mercurial code is very clean and concise, and the API doesn't require you to call five methods on seven different instances just to get at a diff of changes.
The code is, of course, in a repo. It doesn't work with hg 1.0 because I'm too lazy to rewrite the nice command wrapping helper they added in the trunk :)
— gaspode on Tuesday, November 25, 2008 7:45 #
— Michael Watkins on Tuesday, November 25, 2008 17:05 #
@Michael: there should already be a Python3Lexer :)
— Georg on Tuesday, November 25, 2008 18:42 #
The package I miss most over on Python 3 is docutils, and I'd also add Pygments to that.
I did note your Nov 25th post on the docutils mailing list. :-)
I recently had a quick look at 2to3'ing docutils and decided very quickly that what was left to do was beyond my understanding of the insides of docutils.
— Michael Watkins on Thursday, November 27, 2008 16:06 #
I've already made an attempt to convert it, and since it's smaller than docutils, and most of the lexer definitions won't need any work at all, I expect a Python 3 egg will be available with the next release.
— Georg on Thursday, November 27, 2008 17:05 #