Search code examples
mercurialtortoisehg

Connecting the unversioned code to existing branch in Mercurial


I do have a copy of code which does not have the .hg and its not connected with repository. (v1.1). The code was actully pulled from repo only, but during the development somehow the .hg files got deleted and its disconnected from repo.

hg status shows the error message (.hg not found).

In the repository it has the v1.0 code, since the v1.1 is in the zip file and does not connected with repo, I am not sure how to push the v1.1 code to the repository. I am using kiln mercurial repository.


Solution

  • I'd simply do the following:

    1. Re-clone the repository
    2. Delete all files except those in the .hg folder
    3. Copy the v1.1 files in
    4. Test that it compiles and works
    5. Commit the changes (including deleted and added files)
    6. Push

    This will give you a repository with only one commit between v1.0 and v1.1 but that's the best that you can get if you've deleted the .hg folder.