comparison mercurial/httprepo.py @ 5255:65dc707606ed

Push capability checking into protocol-level code.
author Bryan O'Sullivan <bos@serpentine.com>
date Mon, 27 Aug 2007 14:48:08 -0700
parents b534c502bfb3
children 24de027551c1
comparison
equal deleted inserted replaced
5254:b534c502bfb3 5255:65dc707606ed
352 finally: 352 finally:
353 # if using keepalive, allow connection to be reused 353 # if using keepalive, allow connection to be reused
354 fp.close() 354 fp.close()
355 355
356 def lookup(self, key): 356 def lookup(self, key):
357 self.requirecap('lookup', _('look up remote revision'))
357 d = self.do_cmd("lookup", key = key).read() 358 d = self.do_cmd("lookup", key = key).read()
358 success, data = d[:-1].split(' ', 1) 359 success, data = d[:-1].split(' ', 1)
359 if int(success): 360 if int(success):
360 return bin(data) 361 return bin(data)
361 raise repo.RepoError(data) 362 raise repo.RepoError(data)
389 n = " ".join(map(hex, nodes)) 390 n = " ".join(map(hex, nodes))
390 f = self.do_cmd("changegroup", roots=n) 391 f = self.do_cmd("changegroup", roots=n)
391 return util.chunkbuffer(zgenerator(f)) 392 return util.chunkbuffer(zgenerator(f))
392 393
393 def changegroupsubset(self, bases, heads, source): 394 def changegroupsubset(self, bases, heads, source):
395 self.requirecap('changegroupsubset', _('look up remote changes'))
394 baselst = " ".join([hex(n) for n in bases]) 396 baselst = " ".join([hex(n) for n in bases])
395 headlst = " ".join([hex(n) for n in heads]) 397 headlst = " ".join([hex(n) for n in heads])
396 f = self.do_cmd("changegroupsubset", bases=baselst, heads=headlst) 398 f = self.do_cmd("changegroupsubset", bases=baselst, heads=headlst)
397 return util.chunkbuffer(zgenerator(f)) 399 return util.chunkbuffer(zgenerator(f))
398 400