[PATCH RFC] clone: copy hgrc paths if source and dest are local

Bill Barry after.fallout at gmail.com
Sun Jun 13 09:35:16 CDT 2010


Adrian Buehlmann wrote:
> On 13.06.2010 15:32, Adrian Buehlmann wrote:
>   
>> On 13.06.2010 15:28, Adrian Buehlmann wrote:
>>     
>>> # HG changeset patch
>>> # User Adrian Buehlmann <adrian at cadifra.com>
>>> # Date 1276435473 -7200
>>> # Node ID 237a4167922c61f1ac6ad68e6fcf62a3f15c446f
>>> # Parent  285bcf40e04bf8ec0980d3238a4d71e886054ed9
>>> clone: copy hgrc paths if source and dest are local
>>>
>>> diff --git a/mercurial/hg.py b/mercurial/hg.py
>>> --- a/mercurial/hg.py
>>> +++ b/mercurial/hg.py
>>> @@ -344,6 +344,10 @@ def clone(ui, source, dest=None, pull=Fa
>>>              fp = dest_repo.opener("hgrc", "w", text=True)
>>>              fp.write("[paths]\n")
>>>              fp.write("default = %s\n" % abspath)
>>> +            if src_repo.local():
>>> +                for n, p in src_repo.ui.configitems('paths'):
>>> +                    if n != 'default':
>>> +                        fp.write("%s = %s\n" % (n, p))
>>>              fp.close()
>>>  
>>>              dest_repo.ui.setconfig('paths', 'default', abspath)
>>>       
>> Would this make sense?
>>
>>     
>
> No it doesn't, as it sets repo-local identical overrides for global
> config paths in the local .hg/hgrc of the destination repo, which is
> unwanted.

+1

If you want global paths, simply set them up globally. My local paths 
are usually localized from one repo to another.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100613/249450ef/attachment.htm>


More information about the Mercurial-devel mailing list