Changing existing subrepo mappings from absolute to relative paths

Angel Ezquerra angel.ezquerra at gmail.com
Thu Dec 15 15:21:56 CST 2011


On Thu, Dec 15, 2011 at 6:57 PM, Martin Geisler <mg at lazybytes.net> wrote:
> Angel Ezquerra <angel.ezquerra at gmail.com> writes:
>
>> On Thu, Dec 15, 2011 at 9:27 AM, Martin Geisler <mg at lazybytes.net> wrote:
>>> Angel Ezquerra <angel.ezquerra at gmail.com> writes:
>>>
>>>> My next attempt was to create an .hg/supaths file with the following
>>>> contents:
>>>>
>>>> [subpaths]
>>>> \\mercurial\Mercurial\HSPA\FPGA\COMMON = HSPA_MODULES/COMMON
>>>
>>> Ah, the .hg/subpaths file is not read by normal Mercurial. It was a
>>> file read by an early version of the subpaths extension I put on
>>> Bitbucket. That extension is now called projrc and can set more than
>>> just subpaths settings.
>>>
>>> So you need to do the remapping in a config file actually read by
>>> Mercurial -- like the .hg/hgrc file.
>>
>> Martin,
>>
>> the first Google result for "mercurial subpaths" is
>> http://mercurial.selenic.com/wiki/SubrepoRemappingPlan, which is where
>> the usage of the subpaths file is explained. Perhaps it would make
>> sense to update that wiki page with a link to the new extension?
>
> Yeah it would be good to update the page! I only renames the
> SubpathsExtension page so that if you click on SubpathsExtension, you'll
> be redirected to ProjrcExtension automatically.
>
>> BTW, I think you had mentioned this projrc extension in the past. I
>> think it can be very useful, particularly on "corporate" environments
>> where there is often the need to make sure (to a certain degree) that
>> all developers have a similar configuration for a given project. I
>> wish it was distributed with mercurial as an official extension!
>
> It's a very dangerous extension... it easily opens you up for all sorts
> of remote exploits. But it's also very convenient in a trusted,
> corporate environment, which is exactly what it was written for :)

It is certainly a dangerous extension as it is. However since it must
be enabled on the client, it does not seem that distributing it with
mercurial would be dangerous on itself.
People can still install it if they want after all... this would just
make it more convenient for those that want to use it, and would
change nothing for those that do not want to use it, would it?

Also, I think that the extension could be made less dangerous if it
was a bit more configurable. Currently it is an all or nothing thing.
You either enable it, accepting all the settings in the projrc file or
you don't and you ignore all the settings in that file. Perhaps the
extension could have to be configured to explicitly set which sections
of the projrc file you want to automatically load (the rest would be
ignored). That way you could for example _not_ enable the hooks
section, which I guess is the most dangerous of all. Or you could just
enable it for some repos. Or even just enable a particular hook but
not others.

Angel


More information about the Mercurial mailing list