mercurial/pushkey.py
changeset 21650 a2c7ae21e8f4
parent 17298 59c14bf5a48c
child 21652 ed6e61eaebc0
equal deleted inserted replaced
21649:3bfadd70550b 21650:a2c7ae21e8f4
     3 # Copyright 2010 Matt Mackall <mpm@selenic.com>
     3 # Copyright 2010 Matt Mackall <mpm@selenic.com>
     4 #
     4 #
     5 # This software may be used and distributed according to the terms of the
     5 # This software may be used and distributed according to the terms of the
     6 # GNU General Public License version 2 or any later version.
     6 # GNU General Public License version 2 or any later version.
     7 
     7 
     8 import bookmarks, phases, obsolete
     8 import bookmarks, phases, obsolete, encoding
     9 
     9 
    10 def _nslist(repo):
    10 def _nslist(repo):
    11     n = {}
    11     n = {}
    12     for k in _namespaces:
    12     for k in _namespaces:
    13         n[k] = ""
    13         n[k] = ""
    35 def list(repo, namespace):
    35 def list(repo, namespace):
    36     '''return a dict'''
    36     '''return a dict'''
    37     lk = _get(namespace)[1]
    37     lk = _get(namespace)[1]
    38     return lk(repo)
    38     return lk(repo)
    39 
    39 
       
    40 def encodekeys(keys):
       
    41     """encode the content of a pushkey namespace for exchange over the wire"""
       
    42     enc = encoding.fromlocal
       
    43     return '\n'.join(['%s\t%s' % (enc(k), enc(v)) for k, v in keys])