mercurial/wireprotov1server.py
changeset 43117 8ff1ecfadcd1
parent 43106 d783f945a701
child 43729 1d1232c0726f
equal deleted inserted replaced
43116:defabf63e969 43117:8ff1ecfadcd1
    39 urlerr = util.urlerr
    39 urlerr = util.urlerr
    40 urlreq = util.urlreq
    40 urlreq = util.urlreq
    41 
    41 
    42 bundle2requiredmain = _(b'incompatible Mercurial client; bundle2 required')
    42 bundle2requiredmain = _(b'incompatible Mercurial client; bundle2 required')
    43 bundle2requiredhint = _(
    43 bundle2requiredhint = _(
    44     b'see https://www.mercurial-scm.org/wiki/' b'IncompatibleClient'
    44     b'see https://www.mercurial-scm.org/wiki/IncompatibleClient'
    45 )
    45 )
    46 bundle2required = b'%s\n(%s)\n' % (bundle2requiredmain, bundle2requiredhint)
    46 bundle2required = b'%s\n(%s)\n' % (bundle2requiredmain, bundle2requiredhint)
    47 
    47 
    48 
    48 
    49 def clientcompressionsupport(proto):
    49 def clientcompressionsupport(proto):
   163     if args is None:
   163     if args is None:
   164         args = b''
   164         args = b''
   165 
   165 
   166     if not isinstance(args, bytes):
   166     if not isinstance(args, bytes):
   167         raise error.ProgrammingError(
   167         raise error.ProgrammingError(
   168             b'arguments for version 1 commands ' b'must be declared as bytes'
   168             b'arguments for version 1 commands must be declared as bytes'
   169         )
   169         )
   170 
   170 
   171     def register(func):
   171     def register(func):
   172         if name in commands:
   172         if name in commands:
   173             raise error.ProgrammingError(
   173             raise error.ProgrammingError(
   174                 b'%s command already registered ' b'for version 1' % name
   174                 b'%s command already registered for version 1' % name
   175             )
   175             )
   176         commands[name] = wireprototypes.commandentry(
   176         commands[name] = wireprototypes.commandentry(
   177             func, args=args, transports=transports, permission=permission
   177             func, args=args, transports=transports, permission=permission
   178         )
   178         )
   179 
   179