I'm trying to set up subrepo remapping in Mercurial (2.1.1) to account for subrepo paths that may change in the future. I've been able to get the [subpaths]
key to be read and processed properly when it is specified in the .hgrc
file. However, when I clone or pull from that repository, the .hgrc
file is not copied and thus the subrepo remaps are not brought over to the destination repository.
My first thought after looking at the SubrepoRemappingPlan was to put the [subpaths]
in a .hg/subpaths
file, which is supposed to be copied on clones/pulls. However, it turns out this functionality has been obsoleted, and the subpaths file has been replaced with a more general configuration-sharing mechanism via the Projrc extension.
The problems with the Projrc solution, though, are:
it's a separate extension that all team members need to have installed and enabled
additional configuration needs to be done to tell Projrc where it is allowed to pull from (and what it is allowed to pull), for security reasons
So, my question is, is there any built-in mechanism in Mercurial for implementing subrepo mapping that is preserved across clones/pulls?
Adding the subpaths mapping to your
.hgsub
file should do the trick (as described in the mercurial wiki).