Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 639:31cebba881a0
Add addchangegroup to the ssh protocol
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 06 Jul 2005 22:23:57 -0800 |
parents | 35f7adfefa69 |
children | 6ebe118280bd |
comparison
equal
deleted
inserted
replaced
638:35f7adfefa69 | 639:31cebba881a0 |
---|---|
1713 def changegroup(self, nodes): | 1713 def changegroup(self, nodes): |
1714 n = " ".join(map(hex, nodes)) | 1714 n = " ".join(map(hex, nodes)) |
1715 f = self.do_cmd("changegroup", roots=n) | 1715 f = self.do_cmd("changegroup", roots=n) |
1716 return self.pipei | 1716 return self.pipei |
1717 | 1717 |
1718 def addchangegroup(self, cg): | |
1719 d = self.call("addchangegroup") | |
1720 if d: | |
1721 raise RepoError("push refused: %s", d) | |
1722 | |
1723 while 1: | |
1724 d = cg.read(4096) | |
1725 if not d: break | |
1726 self.pipeo.write(d) | |
1727 | |
1728 self.pipeo.flush() | |
1729 | |
1730 l = int(self.pipei.readline()) | |
1731 return self.pipei.read(l) | |
1732 | |
1718 def repository(ui, path=None, create=0): | 1733 def repository(ui, path=None, create=0): |
1719 if path: | 1734 if path: |
1720 if path.startswith("http://"): | 1735 if path.startswith("http://"): |
1721 return httprepository(ui, path) | 1736 return httprepository(ui, path) |
1722 if path.startswith("hg://"): | 1737 if path.startswith("hg://"): |