add a releasefn keyword to lock.lock
releasefn is a function that will be executed when the lock is released
#!/bin/shhg initecho "Is there an error message when trying to diff non-existing files?"hg diff not foundecho "Is there an error message when trying to add non-existing files?"hg add not found