del transaction before lock before wlock
This way rollbacks happen while the repo is still locked.
Deleting lock before wlock is not strictly necessary, but is
more consistent with the locking order.
To run the tests, do:
cd tests/
python run-tests.py
See http://www.selenic.com/mercurial/wiki/index.cgi/WritingTests for
more information on writing tests.