Previously, undolog runs for every command, which sometimes adds unwanted
noticeable overhead like hg status with a large obsstore. This patch makes
undo smarter to only log commands that actually write things.
This is done by making undolog only run for transactions, updates (legacy
code that does not require a transaction). Tests are changed to reflect
hg status does not trigger undolog, and the new code seems to work better
with chg.
You are checking if repo is not None below, but you are not checking it here. It shouldn't cause problems, but it'd be good for consistency to check it there too. Or even check it in the beginning of _runcommandwrapper() function