I’ve given a lot of files that once were in a mercurial repository but now need adding into another one.
Like with svn, mercurial file trees have hidden folders containing details about the commit history. If these get added into a new repo, things stop working properly.
The trick is to recursively delete these folders then all is good.
// find and remove .hg files in the filesystem
find . -name ".hg" -exec rm -rf {} \;
// works with svn files as well
find . -name ".svn" -exec rm -rf {} \;
Filed under: code snippets, development, mercurial, subversion, version control