[PATCH] lfs: add an experimental config to masquerade as git for the blob transfer

Matt Harbison mharbison72 at gmail.com
Tue Dec 12 18:10:58 EST 2017


> On Dec 12, 2017, at 5:48 PM, Augie Fackler <raf at durin42.com> wrote:
> 
> 
>> On Dec 12, 2017, at 17:32, Matt Harbison <mharbison72 at gmail.com> wrote:
>> 
>> diff --git a/hgext/lfs/blobstore.py b/hgext/lfs/blobstore.py
>> --- a/hgext/lfs/blobstore.py
>> +++ b/hgext/lfs/blobstore.py
>> @@ -101,7 +101,10 @@ class _gitlfsremote(object):
>>        self.ui = ui
>>        baseurl, authinfo = url.authinfo()
>>        self.baseurl = baseurl.rstrip('/')
>> -        self.urlopener = urlmod.opener(ui, authinfo)
>> +        useragent = None
>> +        if repo.ui.configbool('experimental', 'lfs.git-user-agent'):
>> +            useragent = 'git/2.15.1'
> 
> what happens if you say something like 'git/2.15.1 (compatible; Mercurial %s)' % util.version()? Does that work?

I’ll give it a try tomorrow. I suspect it will be totally dependent on the particular server.

I wonder if in the future, the git version would ever be checked by 3rd party servers to know what features to support, or something like that.



More information about the Mercurial-devel mailing list