diff -r e6045fc3cd50 -r 3505fcd5a231 mercurial/httprepo.py --- a/mercurial/httprepo.py Wed Oct 18 02:08:33 2006 -0500 +++ b/mercurial/httprepo.py Sat Sep 09 18:25:06 2006 -0700 @@ -261,6 +261,14 @@ # if using keepalive, allow connection to be reused fp.close() + def lookup(self, key): + try: + d = self.do_cmd("lookup", key = key).read() + return bin(d[:-1]) + except: + self.ui.warn('Not able to look up revision named "%s"\n' % (key,)) + raise + def heads(self): d = self.do_read("heads") try: @@ -298,6 +306,22 @@ try: for chnk in f: yield zd.decompress(chnk) + except httplib.HTTPException, inst: + raise IOError(None, _('connection ended unexpectedly')) + yield zd.flush() + + return util.chunkbuffer(zgenerator(util.filechunkiter(f))) + + def changegroupsubset(self, bases, heads, source): + baselst = " ".join([hex(n) for n in bases]) + headlst = " ".join([hex(n) for n in heads]) + f = self.do_cmd("changegroupsubset", bases=baselst, heads=headlst) + + def zgenerator(f): + zd = zlib.decompressobj() + try: + for chnk in f: + yield zd.decompress(chnk) except httplib.HTTPException: raise IOError(None, _('connection ended unexpectedly')) yield zd.flush()