D2083: wireprotoserver: remove redirect() and restore() (API)

2018-02-12 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG56fe8a3b2d52: wireprotoserver: remove redirect() and 
restore() (API) (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2083?vs=5346=5529

REVISION DETAIL
  https://phab.mercurial-scm.org/D2083

AFFECTED FILES
  mercurial/wireprotoserver.py

CHANGE DETAILS

diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py
--- a/mercurial/wireprotoserver.py
+++ b/mercurial/wireprotoserver.py
@@ -88,23 +88,6 @@
 won't be captured.
 """
 
-@abc.abstractmethod
-def redirect(self):
-"""may setup interception for stdout and stderr
-
-See also the `restore` method."""
-
-# If the `redirect` function does install interception, the `restore`
-# function MUST be defined. If interception is not used, this function
-# MUST NOT be defined.
-#
-# left commented here on purpose
-#
-#def restore(self):
-#"""reinstall previous stdout and stderr and return intercepted stdout
-#"""
-#raise NotImplementedError()
-
 def decodevaluefromheaders(req, headerprefix):
 """Decode a long value from multiple HTTP request headers.
 
@@ -181,15 +164,6 @@
 self._ui.fout = oldout
 self._ui.ferr = olderr
 
-def redirect(self):
-self._oldio = self._ui.fout, self._ui.ferr
-self._ui.ferr = self._ui.fout = stringio()
-
-def restore(self):
-val = self._ui.fout.getvalue()
-self._ui.ferr, self._ui.fout = self._oldio
-return val
-
 def _client(self):
 return 'remote:%s:%s:%s' % (
 self._req.env.get('wsgi.url_scheme') or 'http',
@@ -425,9 +399,6 @@
 def mayberedirectstdio(self):
 yield None
 
-def redirect(self):
-pass
-
 def _client(self):
 client = encoding.environ.get('SSH_CLIENT', '').split(' ', 1)[0]
 return 'remote:ssh:' + client



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


D2083: wireprotoserver: remove redirect() and restore() (API)

2018-02-07 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 5346.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2083?vs=5335=5346

REVISION DETAIL
  https://phab.mercurial-scm.org/D2083

AFFECTED FILES
  mercurial/wireprotoserver.py

CHANGE DETAILS

diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py
--- a/mercurial/wireprotoserver.py
+++ b/mercurial/wireprotoserver.py
@@ -88,23 +88,6 @@
 won't be captured.
 """
 
-@abc.abstractmethod
-def redirect(self):
-"""may setup interception for stdout and stderr
-
-See also the `restore` method."""
-
-# If the `redirect` function does install interception, the `restore`
-# function MUST be defined. If interception is not used, this function
-# MUST NOT be defined.
-#
-# left commented here on purpose
-#
-#def restore(self):
-#"""reinstall previous stdout and stderr and return intercepted stdout
-#"""
-#raise NotImplementedError()
-
 def decodevaluefromheaders(req, headerprefix):
 """Decode a long value from multiple HTTP request headers.
 
@@ -181,15 +164,6 @@
 self._ui.fout = oldout
 self._ui.ferr = olderr
 
-def redirect(self):
-self._oldio = self._ui.fout, self._ui.ferr
-self._ui.ferr = self._ui.fout = stringio()
-
-def restore(self):
-val = self._ui.fout.getvalue()
-self._ui.ferr, self._ui.fout = self._oldio
-return val
-
 def _client(self):
 return 'remote:%s:%s:%s' % (
 self._req.env.get('wsgi.url_scheme') or 'http',
@@ -425,9 +399,6 @@
 def mayberedirectstdio(self):
 yield None
 
-def redirect(self):
-pass
-
 def _client(self):
 client = encoding.environ.get('SSH_CLIENT', '').split(' ', 1)[0]
 return 'remote:ssh:' + client



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


D2083: wireprotoserver: remove redirect() and restore() (API)

2018-02-07 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 5335.
indygreg edited the summary of this revision.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2083?vs=5317=5335

REVISION DETAIL
  https://phab.mercurial-scm.org/D2083

AFFECTED FILES
  mercurial/wireprotoserver.py

CHANGE DETAILS

diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py
--- a/mercurial/wireprotoserver.py
+++ b/mercurial/wireprotoserver.py
@@ -88,23 +88,6 @@
 won't be captured.
 """
 
-@abc.abstractmethod
-def redirect(self):
-"""may setup interception for stdout and stderr
-
-See also the `restore` method."""
-
-# If the `redirect` function does install interception, the `restore`
-# function MUST be defined. If interception is not used, this function
-# MUST NOT be defined.
-#
-# left commented here on purpose
-#
-#def restore(self):
-#"""reinstall previous stdout and stderr and return intercepted stdout
-#"""
-#raise NotImplementedError()
-
 def decodevaluefromheaders(req, headerprefix):
 """Decode a long value from multiple HTTP request headers.
 
@@ -181,15 +164,6 @@
 self._ui.fout = oldout
 self._ui.ferr = olderr
 
-def redirect(self):
-self._oldio = self._ui.fout, self._ui.ferr
-self._ui.ferr = self._ui.fout = stringio()
-
-def restore(self):
-val = self._ui.fout.getvalue()
-self._ui.ferr, self._ui.fout = self._oldio
-return val
-
 def _client(self):
 return 'remote:%s:%s:%s' % (
 self._req.env.get('wsgi.url_scheme') or 'http',
@@ -425,9 +399,6 @@
 def mayberedirectstdio(self):
 yield None
 
-def redirect(self):
-pass
-
 def _client(self):
 client = encoding.environ.get('SSH_CLIENT', '').split(' ', 1)[0]
 return 'remote:ssh:' + client



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


D2083: wireprotoserver: remove redirect() and restore() (API)

2018-02-07 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  They are no longer used in core.
  
  .. api::
  
redirect() and restore() have been removed from the wire protocol
handler interface. Use mayberedirectstdio() instead.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2083

AFFECTED FILES
  mercurial/wireprotoserver.py

CHANGE DETAILS

diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py
--- a/mercurial/wireprotoserver.py
+++ b/mercurial/wireprotoserver.py
@@ -88,23 +88,6 @@
 won't be captured.
 """
 
-@abc.abstractmethod
-def redirect(self):
-"""may setup interception for stdout and stderr
-
-See also the `restore` method."""
-
-# If the `redirect` function does install interception, the `restore`
-# function MUST be defined. If interception is not used, this function
-# MUST NOT be defined.
-#
-# left commented here on purpose
-#
-#def restore(self):
-#"""reinstall previous stdout and stderr and return intercepted stdout
-#"""
-#raise NotImplementedError()
-
 def decodevaluefromheaders(req, headerprefix):
 """Decode a long value from multiple HTTP request headers.
 
@@ -181,15 +164,6 @@
 self._ui.fout = oldout
 self._ui.ferr = olderr
 
-def redirect(self):
-self._oldio = self._ui.fout, self._ui.ferr
-self._ui.ferr = self._ui.fout = stringio()
-
-def restore(self):
-val = self._ui.fout.getvalue()
-self._ui.ferr, self._ui.fout = self._oldio
-return val
-
 def _client(self):
 return 'remote:%s:%s:%s' % (
 self._req.env.get('wsgi.url_scheme') or 'http',
@@ -406,9 +380,6 @@
 def mayberedirectstdio(self):
 yield None
 
-def redirect(self):
-pass
-
 def _sendresponse(self, v):
 self._fout.write("%d\n" % len(v))
 self._fout.write(v)



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