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

Adrian Buehlmann adrian at cadifra.com
Sun Jun 13 09:09:17 CDT 2010


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.


More information about the Mercurial-devel mailing list