Mercurial > public > mercurial-scm > hg-stable
diff mercurial/sshserver.py @ 11584:1af96b090116
protocol: unify changegroup commands
- add sendchangegroup protocol helpers
- handle commands with None results
- move changegroup commands into wireproto.py
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 14 Jul 2010 15:43:20 -0500 |
parents | 4530b3307fb9 |
children | 5d907fbb9703 |
line wrap: on
line diff
--- a/mercurial/sshserver.py Wed Jul 14 15:33:21 2010 -0500 +++ b/mercurial/sshserver.py Wed Jul 14 15:43:20 2010 -0500 @@ -58,6 +58,15 @@ self.fout.write(v) self.fout.flush() + def sendchangegroup(self, changegroup): + while True: + d = changegroup.read(4096) + if not d: + break + self.fout.write(d) + + self.fout.flush() + def serve_forever(self): try: while self.serve_one(): @@ -105,34 +114,6 @@ self.lock = None return "" - def do_changegroup(self): - nodes = [] - roots = self.getarg('roots') - nodes = map(bin, roots.split(" ")) - - cg = self.repo.changegroup(nodes, 'serve') - while True: - d = cg.read(4096) - if not d: - break - self.fout.write(d) - - self.fout.flush() - - def do_changegroupsubset(self): - bases, heads = self.getargs('bases heads') - bases = [bin(n) for n in bases.split(' ')] - heads = [bin(n) for n in heads.split(' ')] - - cg = self.repo.changegroupsubset(bases, heads, 'serve') - while True: - d = cg.read(4096) - if not d: - break - self.fout.write(d) - - self.fout.flush() - def do_addchangegroup(self): '''DEPRECATED'''