Mercurial > hg
comparison mercurial/localrepo.py @ 20963:ffddabb8aa5d
bundle2: use discard to remove bundle2 cap
caps.remove('bundle2') was throwing an exception if bundle2 wasn't present in
the capabilities. This was causing test-static-http.t to hang. Let's just use
discard, so we don't get an exception.
author | Durham Goode <durham@fb.com> |
---|---|
date | Tue, 08 Apr 2014 13:05:29 -0700 |
parents | 12f161f08d74 |
children | 7a679918ee2b |
comparison
equal
deleted
inserted
replaced
20962:af4158b8876b | 20963:ffddabb8aa5d |
---|---|
279 def _restrictcapabilities(self, caps): | 279 def _restrictcapabilities(self, caps): |
280 # bundle2 is not ready for prime time, drop it unless explicitly | 280 # bundle2 is not ready for prime time, drop it unless explicitly |
281 # required by the tests (or some brave tester) | 281 # required by the tests (or some brave tester) |
282 if not self.ui.configbool('server', 'bundle2', False): | 282 if not self.ui.configbool('server', 'bundle2', False): |
283 caps = set(caps) | 283 caps = set(caps) |
284 caps.remove('bundle2') | 284 caps.discard('bundle2') |
285 return caps | 285 return caps |
286 | 286 |
287 def _applyrequirements(self, requirements): | 287 def _applyrequirements(self, requirements): |
288 self.requirements = requirements | 288 self.requirements = requirements |
289 self.sopener.options = dict((r, 1) for r in requirements | 289 self.sopener.options = dict((r, 1) for r in requirements |