changeset 27915:5f2a308bac94 stable

commandserver: drop tell() and seek() from channels (issue5049) These operations are obviously invalid for file-like channels because they will read or write protocol headers. This patch works around the issue that "hg archive" generates a corrupted zip file on Windows commandserver because of unusable tell() implementation. But the problem still occurs without using a commandserver. $ hg archive -R not-small-repo -t zip - | cat > invalid.zip So, this patch cannot fix the issue5049 completely.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 20 Jan 2016 00:08:00 +0900
parents 505a10b504ed
children 9a09a9cfa503
files mercurial/commandserver.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commandserver.py	Wed Jan 20 11:21:13 2016 -0800
+++ b/mercurial/commandserver.py	Wed Jan 20 00:08:00 2016 +0900
@@ -55,7 +55,7 @@
         self.out.flush()
 
     def __getattr__(self, attr):
-        if attr in ('isatty', 'fileno'):
+        if attr in ('isatty', 'fileno', 'tell', 'seek'):
             raise AttributeError(attr)
         return getattr(self.out, attr)
 
@@ -139,7 +139,7 @@
         return l
 
     def __getattr__(self, attr):
-        if attr in ('isatty', 'fileno'):
+        if attr in ('isatty', 'fileno', 'tell', 'seek'):
             raise AttributeError(attr)
         return getattr(self.in_, attr)