mercurial/wireprotov1server.py
changeset 48913 f254fc73d956
parent 48875 6000f5b25c9b
child 50415 4cafe20b79b6
child 50542 7b723217d368
equal deleted inserted replaced
48912:a0674e916fb6 48913:f254fc73d956
   233 
   233 
   234 @wireprotocommand(b'branchmap', permission=b'pull')
   234 @wireprotocommand(b'branchmap', permission=b'pull')
   235 def branchmap(repo, proto):
   235 def branchmap(repo, proto):
   236     branchmap = repo.branchmap()
   236     branchmap = repo.branchmap()
   237     heads = []
   237     heads = []
   238     for branch, nodes in pycompat.iteritems(branchmap):
   238     for branch, nodes in branchmap.items():
   239         branchname = urlreq.quote(encoding.fromlocal(branch))
   239         branchname = urlreq.quote(encoding.fromlocal(branch))
   240         branchnodes = wireprototypes.encodelist(nodes)
   240         branchnodes = wireprototypes.encodelist(nodes)
   241         heads.append(b'%s %s' % (branchname, branchnodes))
   241         heads.append(b'%s %s' % (branchname, branchnodes))
   242 
   242 
   243     return wireprototypes.bytesresponse(b'\n'.join(heads))
   243     return wireprototypes.bytesresponse(b'\n'.join(heads))
   430 @wireprotocommand(b'getbundle', b'*', permission=b'pull')
   430 @wireprotocommand(b'getbundle', b'*', permission=b'pull')
   431 def getbundle(repo, proto, others):
   431 def getbundle(repo, proto, others):
   432     opts = options(
   432     opts = options(
   433         b'getbundle', wireprototypes.GETBUNDLE_ARGUMENTS.keys(), others
   433         b'getbundle', wireprototypes.GETBUNDLE_ARGUMENTS.keys(), others
   434     )
   434     )
   435     for k, v in pycompat.iteritems(opts):
   435     for k, v in opts.items():
   436         keytype = wireprototypes.GETBUNDLE_ARGUMENTS[k]
   436         keytype = wireprototypes.GETBUNDLE_ARGUMENTS[k]
   437         if keytype == b'nodes':
   437         if keytype == b'nodes':
   438             opts[k] = wireprototypes.decodelist(v)
   438             opts[k] = wireprototypes.decodelist(v)
   439         elif keytype == b'csv':
   439         elif keytype == b'csv':
   440             opts[k] = list(v.split(b','))
   440             opts[k] = list(v.split(b','))