##// END OF EJS Templates
httprepo: use caps instead of between for compat check...
Peter Arrenbrecht -
r13603:395a84f7 default
parent child Browse files
Show More
@@ -52,10 +52,13 b' class httprepository(wireproto.wirerepos'
52 52
53 53 # look up capabilities only when needed
54 54
55 def _fetchcaps(self):
56 self.caps = set(self._call('capabilities').split())
57
55 58 def get_caps(self):
56 59 if self.caps is None:
57 60 try:
58 self.caps = set(self._call('capabilities').split())
61 self._fetchcaps()
59 62 except error.RepoError:
60 63 self.caps = set()
61 64 self.ui.debug('capabilities: %s\n' %
@@ -195,7 +198,13 b' def instance(ui, path, create):'
195 198 inst = httpsrepository(ui, path)
196 199 else:
197 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 208 return inst
200 209 except error.RepoError:
201 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 98 updating to branch default
99 99 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
100 100 $ cat proxy.log
101 * - - [*] "GET http://localhost:$HGPORT/?cmd=between&pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 HTTP/1.1" - - (glob)
102 101 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
103 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 104 * - - [*] "GET http://localhost:$HGPORT/?cmd=heads HTTP/1.1" - - (glob)
106 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 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 108 * - - [*] "GET http://localhost:$HGPORT/?cmd=heads HTTP/1.1" - - (glob)
111 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 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 112 * - - [*] "GET http://localhost:$HGPORT/?cmd=heads HTTP/1.1" - - (glob)
116 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 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 116 * - - [*] "GET http://localhost:$HGPORT/?cmd=heads HTTP/1.1" - - (glob)
121 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 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 26 $ hg incoming --debug parts://localhost
27 27 using http://localhost:$HGPORT/
28 sending between command
28 sending capabilities command
29 29 comparing with parts://localhost
30 30 sending heads command
31 31 searching for changes
General Comments 0
You need to be logged in to leave comments. Login now