mercurial/wireproto.py
changeset 35982 5a56bf4180ad
parent 35981 ef683a0fd21f
child 36066 2ad145fbde54
equal deleted inserted replaced
35981:ef683a0fd21f 35982:5a56bf4180ad
   688         else:
   688         else:
   689             raise ValueError('command entries must be commandentry instances '
   689             raise ValueError('command entries must be commandentry instances '
   690                              'or 2-tuples')
   690                              'or 2-tuples')
   691 
   691 
   692         return super(commanddict, self).__setitem__(k, v)
   692         return super(commanddict, self).__setitem__(k, v)
       
   693 
       
   694     def commandavailable(self, command, proto):
       
   695         """Determine if a command is available for the requested protocol."""
       
   696         # For now, commands are available for all protocols. So do a simple
       
   697         # membership test.
       
   698         return command in self
   693 
   699 
   694 commands = commanddict()
   700 commands = commanddict()
   695 
   701 
   696 def wireprotocommand(name, args=''):
   702 def wireprotocommand(name, args=''):
   697     """Decorator to declare a wire protocol command.
   703     """Decorator to declare a wire protocol command.