mercurial/repo.py
changeset 2612 ffb895f16925
parent 1089 142b5d5ec9cc
child 2858 345bac2bc4ec
equal deleted inserted replaced
2611:1b4eb1f92433 2612:ffb895f16925
     3 # Copyright 2005 Matt Mackall <mpm@selenic.com>
     3 # Copyright 2005 Matt Mackall <mpm@selenic.com>
     4 #
     4 #
     5 # This software may be used and distributed according to the terms
     5 # This software may be used and distributed according to the terms
     6 # of the GNU General Public License, incorporated herein by reference.
     6 # of the GNU General Public License, incorporated herein by reference.
     7 
     7 
     8 class RepoError(Exception): pass
     8 class RepoError(Exception):
       
     9     pass
       
    10 
       
    11 class repository(object):
       
    12     def capable(self, name):
       
    13         '''tell whether repo supports named capability.
       
    14         return False if not supported.
       
    15         if boolean capability, return True.
       
    16         if string capability, return string.'''
       
    17         name_eq = name + '='
       
    18         for cap in self.capabilities:
       
    19             if name == cap:
       
    20                 return True
       
    21             if cap.startswith(name_eq):
       
    22                 return cap[len(name_eq):]
       
    23         return False