Allow callers to pass in the dirstate lock in most localrepo.py funcs.
This makes it possible to take the lock once and commit a large number of
patches, without having to read and write the dirstate for each patch.
requesting all changes
abort: error: Connection refused
255
ls: copy: No such file or directory
requesting all changes
abort: HTTP Error 404: File not found
255