equal
deleted
inserted
replaced
50 def url(self): |
50 def url(self): |
51 return self.path |
51 return self.path |
52 |
52 |
53 # look up capabilities only when needed |
53 # look up capabilities only when needed |
54 |
54 |
|
55 def _fetchcaps(self): |
|
56 self.caps = set(self._call('capabilities').split()) |
|
57 |
55 def get_caps(self): |
58 def get_caps(self): |
56 if self.caps is None: |
59 if self.caps is None: |
57 try: |
60 try: |
58 self.caps = set(self._call('capabilities').split()) |
61 self._fetchcaps() |
59 except error.RepoError: |
62 except error.RepoError: |
60 self.caps = set() |
63 self.caps = set() |
61 self.ui.debug('capabilities: %s\n' % |
64 self.ui.debug('capabilities: %s\n' % |
62 (' '.join(self.caps or ['none']))) |
65 (' '.join(self.caps or ['none']))) |
63 return self.caps |
66 return self.caps |
193 try: |
196 try: |
194 if path.startswith('https:'): |
197 if path.startswith('https:'): |
195 inst = httpsrepository(ui, path) |
198 inst = httpsrepository(ui, path) |
196 else: |
199 else: |
197 inst = httprepository(ui, path) |
200 inst = httprepository(ui, path) |
198 inst.between([(nullid, nullid)]) |
201 try: |
|
202 # Try to do useful work when checking compatibility. |
|
203 # Usually saves a roundtrip since we want the caps anyway. |
|
204 inst._fetchcaps() |
|
205 except error.RepoError: |
|
206 # No luck, try older compatibility check. |
|
207 inst.between([(nullid, nullid)]) |
199 return inst |
208 return inst |
200 except error.RepoError: |
209 except error.RepoError: |
201 ui.note('(falling back to static-http)\n') |
210 ui.note('(falling back to static-http)\n') |
202 return statichttprepo.instance(ui, "static-" + path, create) |
211 return statichttprepo.instance(ui, "static-" + path, create) |