mercurial/hg.py
changeset 639 31cebba881a0
parent 638 35f7adfefa69
child 644 6ebe118280bd
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://"):