Show More
@@ -135,7 +135,7 b' class _multifile(object):' | |||||
135 |
|
135 | |||
136 | class httppeer(wireproto.wirepeer): |
|
136 | class httppeer(wireproto.wirepeer): | |
137 | def __init__(self, ui, path, url, opener): |
|
137 | def __init__(self, ui, path, url, opener): | |
138 |
self. |
|
138 | self.ui = ui | |
139 | self._path = path |
|
139 | self._path = path | |
140 | self._url = url |
|
140 | self._url = url | |
141 | self._caps = None |
|
141 | self._caps = None | |
@@ -150,9 +150,9 b' class httppeer(wireproto.wirepeer):' | |||||
150 | getattr(h, "close_all", lambda: None)() |
|
150 | getattr(h, "close_all", lambda: None)() | |
151 |
|
151 | |||
152 | def _openurl(self, req): |
|
152 | def _openurl(self, req): | |
153 |
if (self. |
|
153 | if (self.ui.debugflag | |
154 |
and self. |
|
154 | and self.ui.configbool('devel', 'debug.peer-request')): | |
155 |
dbg = self. |
|
155 | dbg = self.ui.debug | |
156 | line = 'devel-peer-request: %s\n' |
|
156 | line = 'devel-peer-request: %s\n' | |
157 | dbg(line % '%s %s' % (req.get_method(), req.get_full_url())) |
|
157 | dbg(line % '%s %s' % (req.get_method(), req.get_full_url())) | |
158 | hgargssize = None |
|
158 | hgargssize = None | |
@@ -179,17 +179,13 b' class httppeer(wireproto.wirepeer):' | |||||
179 | start = util.timer() |
|
179 | start = util.timer() | |
180 |
|
180 | |||
181 | ret = self._urlopener.open(req) |
|
181 | ret = self._urlopener.open(req) | |
182 |
if self. |
|
182 | if self.ui.configbool('devel', 'debug.peer-request'): | |
183 | dbg(line % ' finished in %.4f seconds (%s)' |
|
183 | dbg(line % ' finished in %.4f seconds (%s)' | |
184 | % (util.timer() - start, ret.code)) |
|
184 | % (util.timer() - start, ret.code)) | |
185 | return ret |
|
185 | return ret | |
186 |
|
186 | |||
187 | # Begin of ipeerconnection interface. |
|
187 | # Begin of ipeerconnection interface. | |
188 |
|
188 | |||
189 | @util.propertycache |
|
|||
190 | def ui(self): |
|
|||
191 | return self._ui |
|
|||
192 |
|
||||
193 | def url(self): |
|
189 | def url(self): | |
194 | return self._path |
|
190 | return self._path | |
195 |
|
191 |
@@ -162,15 +162,11 b' class localpeer(repository.peer):' | |||||
162 | if caps is None: |
|
162 | if caps is None: | |
163 | caps = moderncaps.copy() |
|
163 | caps = moderncaps.copy() | |
164 | self._repo = repo.filtered('served') |
|
164 | self._repo = repo.filtered('served') | |
165 |
self. |
|
165 | self.ui = repo.ui | |
166 | self._caps = repo._restrictcapabilities(caps) |
|
166 | self._caps = repo._restrictcapabilities(caps) | |
167 |
|
167 | |||
168 | # Begin of _basepeer interface. |
|
168 | # Begin of _basepeer interface. | |
169 |
|
169 | |||
170 | @util.propertycache |
|
|||
171 | def ui(self): |
|
|||
172 | return self._ui |
|
|||
173 |
|
||||
174 | def url(self): |
|
170 | def url(self): | |
175 | return self._repo.url() |
|
171 | return self._repo.url() | |
176 |
|
172 |
@@ -354,7 +354,7 b' class sshv1peer(wireproto.wirepeer):' | |||||
354 | stderr and to forward its output. |
|
354 | stderr and to forward its output. | |
355 | """ |
|
355 | """ | |
356 | self._url = url |
|
356 | self._url = url | |
357 |
self. |
|
357 | self.ui = ui | |
358 | # self._subprocess is unused. Keeping a handle on the process |
|
358 | # self._subprocess is unused. Keeping a handle on the process | |
359 | # holds a reference and prevents it from being garbage collected. |
|
359 | # holds a reference and prevents it from being garbage collected. | |
360 | self._subprocess = proc |
|
360 | self._subprocess = proc | |
@@ -379,10 +379,6 b' class sshv1peer(wireproto.wirepeer):' | |||||
379 |
|
379 | |||
380 | # Begin of ipeerconnection interface. |
|
380 | # Begin of ipeerconnection interface. | |
381 |
|
381 | |||
382 | @util.propertycache |
|
|||
383 | def ui(self): |
|
|||
384 | return self._ui |
|
|||
385 |
|
||||
386 | def url(self): |
|
382 | def url(self): | |
387 | return self._url |
|
383 | return self._url | |
388 |
|
384 |
@@ -32,11 +32,7 b" wireprototypes.TRANSPORTS['dummyproto'] " | |||||
32 | class clientpeer(wireproto.wirepeer): |
|
32 | class clientpeer(wireproto.wirepeer): | |
33 | def __init__(self, serverrepo, ui): |
|
33 | def __init__(self, serverrepo, ui): | |
34 | self.serverrepo = serverrepo |
|
34 | self.serverrepo = serverrepo | |
35 |
self. |
|
35 | self.ui = ui | |
36 |
|
||||
37 | @property |
|
|||
38 | def ui(self): |
|
|||
39 | return self._ui |
|
|||
40 |
|
36 | |||
41 | def url(self): |
|
37 | def url(self): | |
42 | return b'test' |
|
38 | return b'test' |
General Comments 0
You need to be logged in to leave comments.
Login now