Search code examples
mercurialwebservertortoisehg

TortoiseHG "thg serve" won't start from command line


I am having a problem executing thg serve from the command line. I am executing the following command line:

thg serve 8082 --web-conf "E:\Mercurial_Repositories\settings.config"

But what I get is the Web Server popping up not configured and not started. But when I do start the web service from within the Workbench the log shows the following execution line:

hg serve --port 8081 --debug --web-conf c:\users\vailla~1\appdata\local\temp\4\thg.lov

Which is odd. I'm assuming that the file thg.lov contains the configuration from the Workbench.


Solution

  • thg serve does not support a port number as an argument. It picks 8000 by default. You can change this value in the Workbench by navigating to File -> Settings -> Workbench and setting the value of the property Port to the value of your choice. Just remove the port number in your call to thg serve and the web server will start running and serving up repositories based on the content of settings.config; the modified command line would thus be thg serve 8082 --web-conf "E:\Mercurial_Repositories\settings.config"