D2084: wireprotoserver: rename _client to client (API)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG957e773614d0: wireprotoserver: rename _client to client (API) (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2084?vs=5347&id=5530 REVISION DETAIL https://phab.mercurial-scm.org/D2084 AFFECTED FILES mercurial/wireproto.py mercurial/wireprotoserver.py CHANGE DETAILS diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py --- a/mercurial/wireprotoserver.py +++ b/mercurial/wireprotoserver.py @@ -88,6 +88,10 @@ won't be captured. """ +@abc.abstractmethod +def client(self): +"""Returns a string representation of this client (as bytes).""" + def decodevaluefromheaders(req, headerprefix): """Decode a long value from multiple HTTP request headers. @@ -164,7 +168,7 @@ self._ui.fout = oldout self._ui.ferr = olderr -def _client(self): +def client(self): return 'remote:%s:%s:%s' % ( self._req.env.get('wsgi.url_scheme') or 'http', urlreq.quote(self._req.env.get('REMOTE_HOST', '')), @@ -399,7 +403,7 @@ def mayberedirectstdio(self): yield None -def _client(self): +def client(self): client = encoding.environ.get('SSH_CLIENT', '').split(' ', 1)[0] return 'remote:ssh:' + client diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -1023,7 +1023,7 @@ hint=bundle2requiredhint) r = exchange.unbundle(repo, gen, their_heads, 'serve', - proto._client()) + proto.client()) if util.safehasattr(r, 'addpart'): # The return looks streamable, we are in the bundle2 case # and should return a stream. To: indygreg, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2084: wireprotoserver: rename _client to client (API)
indygreg updated this revision to Diff 5347. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2084?vs=5336&id=5347 REVISION DETAIL https://phab.mercurial-scm.org/D2084 AFFECTED FILES mercurial/wireproto.py mercurial/wireprotoserver.py CHANGE DETAILS diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py --- a/mercurial/wireprotoserver.py +++ b/mercurial/wireprotoserver.py @@ -88,6 +88,10 @@ won't be captured. """ +@abc.abstractmethod +def client(self): +"""Returns a string representation of this client (as bytes).""" + def decodevaluefromheaders(req, headerprefix): """Decode a long value from multiple HTTP request headers. @@ -164,7 +168,7 @@ self._ui.fout = oldout self._ui.ferr = olderr -def _client(self): +def client(self): return 'remote:%s:%s:%s' % ( self._req.env.get('wsgi.url_scheme') or 'http', urlreq.quote(self._req.env.get('REMOTE_HOST', '')), @@ -399,7 +403,7 @@ def mayberedirectstdio(self): yield None -def _client(self): +def client(self): client = encoding.environ.get('SSH_CLIENT', '').split(' ', 1)[0] return 'remote:ssh:' + client diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -1023,7 +1023,7 @@ hint=bundle2requiredhint) r = exchange.unbundle(repo, gen, their_heads, 'serve', - proto._client()) + proto.client()) if util.safehasattr(r, 'addpart'): # The return looks streamable, we are in the bundle2 case # and should return a stream. To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2084: wireprotoserver: rename _client to client (API)
indygreg updated this revision to Diff 5336. indygreg edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2084?vs=5318&id=5336 REVISION DETAIL https://phab.mercurial-scm.org/D2084 AFFECTED FILES mercurial/wireproto.py mercurial/wireprotoserver.py CHANGE DETAILS diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py --- a/mercurial/wireprotoserver.py +++ b/mercurial/wireprotoserver.py @@ -88,6 +88,10 @@ won't be captured. """ +@abc.abstractmethod +def client(self): +"""Returns a string representation of this client (as bytes).""" + def decodevaluefromheaders(req, headerprefix): """Decode a long value from multiple HTTP request headers. @@ -164,7 +168,7 @@ self._ui.fout = oldout self._ui.ferr = olderr -def _client(self): +def client(self): return 'remote:%s:%s:%s' % ( self._req.env.get('wsgi.url_scheme') or 'http', urlreq.quote(self._req.env.get('REMOTE_HOST', '')), @@ -399,7 +403,7 @@ def mayberedirectstdio(self): yield None -def _client(self): +def client(self): client = encoding.environ.get('SSH_CLIENT', '').split(' ', 1)[0] return 'remote:ssh:' + client diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -1023,7 +1023,7 @@ hint=bundle2requiredhint) r = exchange.unbundle(repo, gen, their_heads, 'serve', - proto._client()) + proto.client()) if util.safehasattr(r, 'addpart'): # The return looks streamable, we are in the bundle2 case # and should return a stream. To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2084: wireprotoserver: rename _client to client (API)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This method is called in wireproto.py. It should be part of the public API. .. api:: The ``_client()`` method of the wire protocol handler interface has been renamed to ``client()``. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2084 AFFECTED FILES mercurial/wireproto.py mercurial/wireprotoserver.py CHANGE DETAILS diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py --- a/mercurial/wireprotoserver.py +++ b/mercurial/wireprotoserver.py @@ -88,6 +88,10 @@ won't be captured. """ +@abc.abstractmethod +def client(self): +"""Returns a string representation of this client (as bytes).""" + def decodevaluefromheaders(req, headerprefix): """Decode a long value from multiple HTTP request headers. @@ -164,7 +168,7 @@ self._ui.fout = oldout self._ui.ferr = olderr -def _client(self): +def client(self): return 'remote:%s:%s:%s' % ( self._req.env.get('wsgi.url_scheme') or 'http', urlreq.quote(self._req.env.get('REMOTE_HOST', '')), @@ -413,7 +417,7 @@ wireproto.ooberror: _sendooberror, } -def _client(self): +def client(self): client = encoding.environ.get('SSH_CLIENT', '').split(' ', 1)[0] return 'remote:ssh:' + client diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -1023,7 +1023,7 @@ hint=bundle2requiredhint) r = exchange.unbundle(repo, gen, their_heads, 'serve', - proto._client()) + proto.client()) if util.safehasattr(r, 'addpart'): # The return looks streamable, we are in the bundle2 case # and should return a stream. To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel