Moving Mercurial’s parent repository

(Updated 2011-08-12: This post was about moving the central repository only, but the solution is the same if any level parent repository, i.e. the one to which the clone command was applied, was moved. Just go to the child repo and edit the .hg/hgrc file.)

I’ve just found myself having renamed the directory, in which my Mercurial’s central repository was located. After this, the hg commit and other ‘local’ commands still work fine, but the out, in, push and pull result in
abort: repository default not found!

The solution is to open the file .hg/hgrc in the local repository directory and change the lines
[paths]
default = ...

so that they point to the correct new location.

Leave a comment