Fix handling of paths when run outside the repo.
The main problem was that dirstate.getcwd() returned just "",
which was interpreted as "we're at the repo root". It now returns
an absolute path.
The util.pathto function was also changed to deal with the "cwd is
an absolute path" case.
abort: edit failed: false exited with status 1
transaction abort!
rollback completed
abort: edit failed: false exited with status 1
transaction abort!
rollback completed