Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hg serve for subrepos

I have a repo with subrepos, and would like to do hg serve.

On other computer, I tried

hg clone http://address:8000/ new_repo

Scenario 1: when my original repo had, in .hgsub, lines of the form:

sub_repo_1 = sub_repo_1
sub_repo_2 = sub_repo_2

I got on other computer:

Requesting all changes
adding changesets
adding manifests
...
updating to branch default
abort: HTTP Error 404: Not Found

(the serve computer just waits after that)

(and only the sub_repo_1 inside new_repo. I have tried update, pull... with errors)

I have tried to actually clone separately sub_repo_2, and kept getting Error 404 (bot on sending and receiving computer).

Scenario 2: Same thing happened when I replaced in .hgsub the lines with

sub_repo_1 = http://address/sub_repo_1
sub_repo_2 = http://address/sub_repo_2

Is hg serve unable to serve subrepos ? Or - what am I doing wrong ?

Note: I have updated the hgrc files inside the subrepos to match the paths in the .hgsub, each time.

like image 826
Thalia Avatar asked Jan 25 '26 21:01

Thalia


2 Answers

You can use TortoiseHG to host a mercurial server for a repository that has subrepositories. TortoiseHG actually calls hg serve with a different web.config file it creates.

To host using TortoiseHG, go to Repository -> Web Server... in TortoiseHG Workbench.

like image 96
Denis Blanchette Avatar answered Jan 28 '26 06:01

Denis Blanchette


hg serve works with subrepos. The thing is that hg serve doesn't automagically recognize that your repo contains subrepos.

Supposing that there's the following folder structure

- repo
  - subrepo1
    + file1.txt
  - subrepo2
    + file2.txt
    + file3.txt

Where repo is the main repository and subrepo1 and subrepo2 are two subrepositories of repo:

  1. Create a web configuration file inside repo. Do not add it in version control. I called it .hgwebconf, you can change the name if you want.
  2. Configure all paths for subrepos in this file. Add the following content:

    [paths]
    /repo = ./* #all repos will be known by the url /repo
    /repo/subrepo1 = subrepo1 #adding subrepo1 to be available in hg serve
    /repo/subrepo2 = subrepo2 #similar to above
    
  3. Execute hg serve using --web-conf property to use the web configuration file created for the paths. Here's an example:

    hg serve --web-conf .hgwebconf <other configurations you use ...>
    

And that's it. Now you could access to your server vía http, clone your repo or any subrepo and work with it.

like image 41
Luiggi Mendoza Avatar answered Jan 28 '26 08:01

Luiggi Mendoza



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!