Mercurial > hg
changeset 11622:1d48681b17a4
protocol: rename send methods to get grouping by prefix
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Fri, 16 Jul 2010 18:18:35 +0200 |
parents | e46a8b2331a6 |
children | 31d0a6d50ee2 |
files | mercurial/hgweb/protocol.py mercurial/sshserver.py mercurial/wireproto.py |
diffstat | 3 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hgweb/protocol.py Fri Jul 16 18:16:15 2010 +0200 +++ b/mercurial/hgweb/protocol.py Fri Jul 16 18:18:35 2010 +0200 @@ -35,7 +35,7 @@ def redirect(self): self.oldio = sys.stdout, sys.stderr sys.stderr = sys.stdout = cStringIO.StringIO() - def respond(self, s): + def sendresponse(self, s): self.req.respond(HTTP_OK, HGTYPE, length=len(s)) self.response = s def sendchangegroup(self, cg): @@ -51,7 +51,7 @@ self.req.respond(HTTP_OK, HGTYPE) for chunk in source: self.req.write(chunk) - def respondpush(self, ret): + def sendpushresponse(self, ret): val = sys.stdout.getvalue() sys.stdout, sys.stderr = self.oldio self.req.respond(HTTP_OK, HGTYPE)
--- a/mercurial/sshserver.py Fri Jul 16 18:16:15 2010 +0200 +++ b/mercurial/sshserver.py Fri Jul 16 18:18:35 2010 +0200 @@ -50,7 +50,7 @@ return self.getargs(name)[0] def getfile(self, fpout): - self.respond('') + self.sendresponse('') count = int(self.fin.readline()) while count: fpout.write(self.fin.read(count)) @@ -59,7 +59,7 @@ def redirect(self): pass - def respond(self, v): + def sendresponse(self, v): self.fout.write("%d\n" % len(v)) self.fout.write(v) self.fout.flush() @@ -78,9 +78,9 @@ self.fout.write(chunk) self.fout.flush() - def respondpush(self, ret): - self.respond('') - self.respond(str(ret)) + def sendpushresponse(self, ret): + self.sendresponse('') + self.sendresponse(str(ret)) def serve_forever(self): try: @@ -100,8 +100,8 @@ if impl: r = impl() if r is not None: - self.respond(r) - else: self.respond("") + self.sendresponse(r) + else: self.sendresponse("") return cmd != '' def do_lock(self): @@ -122,10 +122,10 @@ '''DEPRECATED''' if not self.lock: - self.respond("not locked") + self.sendresponse("not locked") return - self.respond("") + self.sendresponse("") r = self.repo.addchangegroup(self.fin, 'serve', self._client(), lock=self.lock) return str(r)
--- a/mercurial/wireproto.py Fri Jul 16 18:16:15 2010 +0200 +++ b/mercurial/wireproto.py Fri Jul 16 18:18:35 2010 +0200 @@ -138,7 +138,7 @@ args = proto.getargs(spec) r = func(repo, proto, *args) if r != None: - proto.respond(r) + proto.sendresponse(r) def between(repo, proto, pairs): pairs = [decodelist(p, '-') for p in pairs.split(" ")] @@ -262,7 +262,7 @@ sys.stderr.write("abort: %s\n" % inst) finally: lock.release() - proto.respondpush(r) + proto.sendpushresponse(r) finally: fp.close()