Kiln » largefiles » Unity
Clone URL:  

proto: duplicate Mercurial's new out-of-band error signaling code in case it's not present, rather than closing the connection

Changeset 5e4eea03fa1c

Parent 1aa8682c760c

by Profile picture of User 521Andrew Pritchard <andrewp@fogcreek.com>

Changes to one file · Browse files at 5e4eea03fa1c Showing diff from parent 1aa8682c760c Diff from another changeset...

Change 1 of 1 Show Entire File proto.py Stacked
 
126
127
128
 
 
129
130
 
131
132
133
134
 
 
 
135
136
137
138
139
140
141
142
143
 
126
127
128
129
130
131
 
132
133
134
135
 
136
137
138
139
 
 
 
 
 
140
141
142
@@ -126,18 +126,17 @@
 def capabilities(repo, proto):   return capabilities_orig(repo, proto) + ' largefiles=serve'   +# duplicate what Mercurial's new out-of-band errors mechanism does, because +# clients old and new alike both handle it well  def webproto_refuseclient(self, message): - self.req.header([('Content-Type', 'application/octet-stream')]) + self.req.header([('Content-Type', 'application/hg-error')])   return message    def sshproto_refuseclient(self, message): - self.ui.write_err('%s\n' % message) + self.ui.write_err('%s\n-\n' % message) + self.fout.write('\n') + self.fout.flush()   - # somehow, this causes the client to realize we've disconnected but still - # writes the return value - self.ui.fout.close() - self.ui.ferr.close() - self.ui.fin.close()   return ''    def heads(repo, proto):