# HG changeset patch # User Yuya Nishihara # Date 2015-12-13 10:32:01 # Node ID f4ca33e33781baed10e3aa3273c4e95bd86c9824 # Parent 6602a7b9deecb6a7260dcb0770a39b2ca0051f20 commandserver: implement name() to clarify channel is not a plain file Because unknown attributes are delegated to the underlying file object, commandserver channels said they were '' or '' even though they weren't. This patch makes them say ''. diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py --- a/mercurial/commandserver.py +++ b/mercurial/commandserver.py @@ -43,6 +43,10 @@ class channeledoutput(object): self.out = out self.channel = channel + @property + def name(self): + return '<%c-channel>' % self.channel + def write(self, data): if not data: return @@ -75,6 +79,10 @@ class channeledinput(object): self.out = out self.channel = channel + @property + def name(self): + return '<%c-channel>' % self.channel + def read(self, size=-1): if size < 0: # if we need to consume all the clients input, ask for 4k chunks