Search code examples
mercurialwebservertortoisehg

Mercurial connect to webserver


after some research I think I am the only one that is dumb enough to don't understand how to connect to a TortoiseHg on a Webserver with my local Hg.

I can't find any configurations in Hg or am I so stupid and blind?

Can anyone help my helpless brain?


Solution

  • TortoiseHG is simply a GUI for mercurial. It sounds like you are trying to interact with 2 different mercurial repos.

    First of all, to connect to the repo on your webserver you have to make sure it is currently serving. You can do this by going onto that box, opening a cmdline with its current directory as your repo, and then typing

    hg serve
    

    This will then show a message with a url, like

    listening at http://Mywebserver:8000/ (bound to *:8000)
    

    Alternatively, if you have TortoiseHG installed on the webserver, you can rightclick the folder containing the repo, and in the TortoiseHG shell extension click Web Server. In the window that opens, click start to serve the repo.

    This repo is now accessible to any machine than can reach that machine and port.

    To use TortoiseHG to clone this repo from your local machine ( assuming you have tortoiseHG installed on your machine ):

    1. Open an explorer window, Right click, and in the TortoiseHG shell extension click clone.
    2. In source, enter the url that was displayed when you served on the webserver. For destination, you can enter the name of the folder you would like the repo created in.
    3. A clone of that repo will now be created where you specified.

    By default, all its push and pull commands will reference the url of the repo on the webserver. IE, if you do a push or pull cmd on your cloned repo without specify the repo to push or pull to, mercurial will assume it should push or pull to that url.

    To interact with the remote repo:

    1. Navigate to the directory containing your repo.
    2. Right click your repo's folder, and in the TortoiseHG shell extension click Synchronize.
    3. You should see that the url field is already filled in with the url you cloned from. You can now click the incoming, pull, outgoing and push buttons to perform those actions.