upgrade: move optimisation to something more declarative
This is not great yet, but still better than the previous state. This get use
one step closer to having all the possible "actions" clearly declared and moved
in a dedicated module.
Differential Revision: https://phab.mercurial-scm.org/D9475
Mercurial's documentation is kept in reStructuredText format, which is
a simple plain text format that's easy to read and edit:
http://docutils.sourceforge.net/rst.html
It's also convertible to a variety of other formats including standard
UNIX man page format and HTML. You'll need to install Docutils:
http://docutils.sourceforge.net/
Use the Makefile in this directory to generate the man and HTML pages.