Search code examples
mercurialpushtortoisehg

HG PUSH won't push to local directory. Repository not found


I am using Tortoise HG two handle source control for a couple of projects on my local machine. I am pushing to a local directory elsewhere on the HD, just as a way to handle revision history.

My directories are set up like so:

Projects are located here: like MyDocuments\Project1.

I push commits to here:

C:\Repository\Project1 C:\Repository\Project2

For one of these projects, this works. For the other, when I try and push, I get an error that it cannot find the directory. Security settings (Windows 7) are the same for both directories.

MyDocuments\Project2 was under this source control at one time, and then something got messed up. So, I deleted the .hg file and hg directory and started over, creating a new repository there and adding all the files for the initial commit. But the initial commit will not push. It says:

repository C:\Repository\Project2 not found

I'm at a loss. I've deleted the HG files and directory three times and started over, but I cannot push. I've tried pushing to a different directory - no luck. I am guessing something is glitched from trying to start over.


Solution

  • You shouldn't delete the .hg folder as that is what makes it a Mercurial repository.

    I'd say that the solution would be to re-clone the MyDocuments\Project2 repository to C:\Repository\Project2 and start again from there.

    In future, if you get to the position where you feel that you need to delete the .hg folder, don't. Come back here and see if we can do anything to help resolve the problem.