Show More
@@ -52,10 +52,13 b' class httprepository(wireproto.wirerepos' | |||||
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' % | |
@@ -195,7 +198,13 b' def instance(ui, path, create):' | |||||
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') |
@@ -98,27 +98,22 b' do not use the proxy if it is in the no ' | |||||
98 | updating to branch default |
|
98 | updating to branch default | |
99 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
99 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
100 | $ cat proxy.log |
|
100 | $ cat proxy.log | |
101 | * - - [*] "GET http://localhost:$HGPORT/?cmd=between&pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 HTTP/1.1" - - (glob) |
|
|||
102 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
101 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) | |
103 | * - - [*] "GET http://localhost:$HGPORT/?cmd=stream_out HTTP/1.1" - - (glob) |
|
102 | * - - [*] "GET http://localhost:$HGPORT/?cmd=stream_out HTTP/1.1" - - (glob) | |
104 | * - - [*] "GET http://localhost:$HGPORT/?cmd=between&pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 HTTP/1.1" - - (glob) |
|
103 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) | |
105 | * - - [*] "GET http://localhost:$HGPORT/?cmd=heads HTTP/1.1" - - (glob) |
|
104 | * - - [*] "GET http://localhost:$HGPORT/?cmd=heads HTTP/1.1" - - (glob) | |
106 | * - - [*] "GET http://localhost:$HGPORT/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob) |
|
105 | * - - [*] "GET http://localhost:$HGPORT/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob) | |
|
106 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys&namespace=bookmarks HTTP/1.1" - - (glob) | |||
107 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
107 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) | |
108 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys&namespace=bookmarks HTTP/1.1" - - (glob) |
|
|||
109 | * - - [*] "GET http://localhost:$HGPORT/?cmd=between&pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 HTTP/1.1" - - (glob) |
|
|||
110 | * - - [*] "GET http://localhost:$HGPORT/?cmd=heads HTTP/1.1" - - (glob) |
|
108 | * - - [*] "GET http://localhost:$HGPORT/?cmd=heads HTTP/1.1" - - (glob) | |
111 | * - - [*] "GET http://localhost:$HGPORT/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob) |
|
109 | * - - [*] "GET http://localhost:$HGPORT/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob) | |
|
110 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys&namespace=bookmarks HTTP/1.1" - - (glob) | |||
112 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
111 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) | |
113 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys&namespace=bookmarks HTTP/1.1" - - (glob) |
|
|||
114 | * - - [*] "GET http://localhost:$HGPORT/?cmd=between&pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 HTTP/1.1" - - (glob) |
|
|||
115 | * - - [*] "GET http://localhost:$HGPORT/?cmd=heads HTTP/1.1" - - (glob) |
|
112 | * - - [*] "GET http://localhost:$HGPORT/?cmd=heads HTTP/1.1" - - (glob) | |
116 | * - - [*] "GET http://localhost:$HGPORT/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob) |
|
113 | * - - [*] "GET http://localhost:$HGPORT/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob) | |
|
114 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys&namespace=bookmarks HTTP/1.1" - - (glob) | |||
117 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
115 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) | |
118 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys&namespace=bookmarks HTTP/1.1" - - (glob) |
|
|||
119 | * - - [*] "GET http://localhost:$HGPORT/?cmd=between&pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 HTTP/1.1" - - (glob) |
|
|||
120 | * - - [*] "GET http://localhost:$HGPORT/?cmd=heads HTTP/1.1" - - (glob) |
|
116 | * - - [*] "GET http://localhost:$HGPORT/?cmd=heads HTTP/1.1" - - (glob) | |
121 | * - - [*] "GET http://localhost:$HGPORT/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob) |
|
117 | * - - [*] "GET http://localhost:$HGPORT/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob) | |
122 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
|||
123 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys&namespace=bookmarks HTTP/1.1" - - (glob) |
|
118 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys&namespace=bookmarks HTTP/1.1" - - (glob) | |
124 |
|
119 |
@@ -25,7 +25,7 b' check that {1} syntax works' | |||||
25 |
|
25 | |||
26 | $ hg incoming --debug parts://localhost |
|
26 | $ hg incoming --debug parts://localhost | |
27 | using http://localhost:$HGPORT/ |
|
27 | using http://localhost:$HGPORT/ | |
28 |
sending |
|
28 | sending capabilities command | |
29 | comparing with parts://localhost |
|
29 | comparing with parts://localhost | |
30 | sending heads command |
|
30 | sending heads command | |
31 | searching for changes |
|
31 | searching for changes |
General Comments 0
You need to be logged in to leave comments.
Login now