comparison mercurial/hgweb/protocol.py @ 11594:67863f9d805f

protocol: unify server-side capabilities functions
author Matt Mackall <mpm@selenic.com>
date Thu, 15 Jul 2010 13:56:52 -0500
parents d054cc5c7737
children 368cd5325348
comparison
equal deleted inserted replaced
11593:d054cc5c7737 11594:67863f9d805f
19 'changegroupsubset', 'capabilities', 'unbundle', 'stream_out', 19 'changegroupsubset', 'capabilities', 'unbundle', 'stream_out',
20 'branchmap', 'pushkey', 'listkeys' 20 'branchmap', 'pushkey', 'listkeys'
21 ] 21 ]
22 22
23 HGTYPE = 'application/mercurial-0.1' 23 HGTYPE = 'application/mercurial-0.1'
24 basecaps = 'lookup changegroupsubset branchmap pushkey'.split()
25
26 def capabilities(repo, req):
27 caps = copy.copy(basecaps)
28 if streamclone.allowed(repo.ui):
29 caps.append('stream=%d' % repo.changelog.version)
30 if changegroupmod.bundlepriority:
31 caps.append('unbundle=%s' % ','.join(changegroupmod.bundlepriority))
32 rsp = ' '.join(caps)
33 req.respond(HTTP_OK, HGTYPE, length=len(rsp))
34 yield rsp