Mercurial > public > mercurial-scm > hg
comparison hgext/phabricator.py @ 40378:b015f30a91fb
phabricator: do more of the VCR work in demandimport.deactivated()
If I don't do this, VCR gets confused looking for pycurl and other
libraries. I have no idea how this ever worked.
Differential Revision: https://phab.mercurial-scm.org/D5159
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 19 Oct 2018 11:45:25 -0400 |
parents | 38ac525b44c9 |
children | 7e2c58b08e74 |
comparison
equal
deleted
inserted
replaced
40377:18da306e92b5 | 40378:b015f30a91fb |
---|---|
129 if cassette: | 129 if cassette: |
130 import hgdemandimport | 130 import hgdemandimport |
131 with hgdemandimport.deactivated(): | 131 with hgdemandimport.deactivated(): |
132 import vcr as vcrmod | 132 import vcr as vcrmod |
133 import vcr.stubs as stubs | 133 import vcr.stubs as stubs |
134 vcr = vcrmod.VCR( | 134 vcr = vcrmod.VCR( |
135 serializer=r'json', | 135 serializer=r'json', |
136 custom_patches=[ | 136 custom_patches=[ |
137 (urlmod, 'httpconnection', stubs.VCRHTTPConnection), | 137 (urlmod, 'httpconnection', stubs.VCRHTTPConnection), |
138 (urlmod, 'httpsconnection', stubs.VCRHTTPSConnection), | 138 (urlmod, 'httpsconnection', |
139 ]) | 139 stubs.VCRHTTPSConnection), |
140 with vcr.use_cassette(cassette): | 140 ]) |
141 return fn(*args, **kwargs) | 141 with vcr.use_cassette(cassette): |
142 return fn(*args, **kwargs) | |
142 return fn(*args, **kwargs) | 143 return fn(*args, **kwargs) |
143 inner.__name__ = fn.__name__ | 144 inner.__name__ = fn.__name__ |
144 return command(name, fullflags, spec)(inner) | 145 return command(name, fullflags, spec)(inner) |
145 return decorate | 146 return decorate |
146 | 147 |