Mercurial > hg-stable
diff hgext/lfs/blobstore.py @ 35444:e333d27514b0
lfs: add an experimental config to override User-Agent for the blob transfer
This will allow developers to test against various server implementations. I
didn't put it under [devel] because it's possible that some user needs to use it
in the field.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 12 Dec 2017 15:16:02 -0500 |
parents | e7bb5fc4570c |
children | 02f54a1ec9eb |
line wrap: on
line diff
--- a/hgext/lfs/blobstore.py Thu Dec 14 13:04:08 2017 -0500 +++ b/hgext/lfs/blobstore.py Tue Dec 12 15:16:02 2017 -0500 @@ -125,7 +125,9 @@ self.ui = ui baseurl, authinfo = url.authinfo() self.baseurl = baseurl.rstrip('/') - useragent = 'mercurial/%s git/2.15.1' % util.version() + useragent = repo.ui.config('experimental', 'lfs.user-agent') + if not useragent: + useragent = 'mercurial/%s git/2.15.1' % util.version() self.urlopener = urlmod.opener(ui, authinfo, useragent) self.retry = ui.configint('lfs', 'retry')