Is it possible to change the paths of the Mercurial subrepot from absolute to relative

My subrepo was originally defined with an absolute url in .hgsub , which is currently causing some problems. This makes the workflow of the “friendly dictator” impossible, since I want to use an intermediate server on which users clone their working copies. Then I dragged the changes to the intermediate server before pushing them to the main repository (the intermediate server is also the host of continuous integration, so I will not pull the material directly to the wizard). Absolute paths prevent this, since the cloned repo will be transferred directly to the host.

Now the problem is that my hg server displays 404 errors when I try to push my changes made to the .hgsub file. Below is an example of the change I made

 # original subrepo definition common = http://hgserver/disp/common # and after the change common = common 

This does not work, it crashes the following error

 $ hg push pushing to http://hgserver/disp pushing subrepo common abort: HTTP Error 404: Not Found 

Is it possible to reconfigure subrepo this way or do I need to recreate the entire repository?

+4
source share
2 answers

Yes, this should be mutable (and you're right that relative does for a better workflow), however the relative URL is taken relative to the hg root repo where .hgsub lives .hgsub - not where you click (which comes from .hg/hgrc deafult in the paths section.

Here is a pretty normal subrepo layout:

 on server http://hgserver/disp/main http://hgserver/disp/common # the "common" repo http://hgserver/disp/main # the main repo http://hgserver/disp/main/.hgsub # contains "common=../common" 

Then, after cloning, everything works, and the same hgsub works fine on the server as well.

There are many questions about the stack overflow, where people look at the best layouts for the relative settings of the subrepost, and although I did not try to switch from one to the other, I think that if you create a style “next to” the sub-repo with "../sibling" I show above, this will work fine.

+3
source

Note that a problem exists (ed) when:

  • Using ssh (top repo)
  • Subrepos listed relative to the top (as suggested here - and generally desirable) - and
  • The top (ssh) repo referenced by the absolute path.

See http://mercurial.808500.n3.nabble.com/subrepos-with-ssh-urls-with-absolute-paths-td1462834.html . In essence, this forces the use of absolute paths in the .hgsub file that violate the mentioned “friendly dictator” / integration server workflow.

The solution is very desirable, but for now we will have to use absolute paths and re-map for each user in the [subpaths] section.: - (

Note: now this has been fixed: https://www.mercurial-scm.org/repo/hg-stable/rev/71ea5b2b9517 This is version 1.8.3 (and later) version

+1
source

All Articles