Show More
@@ -1,24 +1,27 b'' | |||
|
1 | 1 | # repo.py - repository base classes for mercurial |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2005 Matt Mackall <mpm@selenic.com> |
|
4 | 4 | # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> |
|
5 | 5 | # |
|
6 | 6 | # This software may be used and distributed according to the terms |
|
7 | 7 | # of the GNU General Public License, incorporated herein by reference. |
|
8 | 8 | |
|
9 | 9 | class RepoError(Exception): |
|
10 | 10 | pass |
|
11 | 11 | |
|
12 | class LookupError(RepoError): | |
|
13 | pass | |
|
14 | ||
|
12 | 15 | class repository(object): |
|
13 | 16 | def capable(self, name): |
|
14 | 17 | '''tell whether repo supports named capability. |
|
15 | 18 | return False if not supported. |
|
16 | 19 | if boolean capability, return True. |
|
17 | 20 | if string capability, return string.''' |
|
18 | 21 | name_eq = name + '=' |
|
19 | 22 | for cap in self.capabilities: |
|
20 | 23 | if name == cap: |
|
21 | 24 | return True |
|
22 | 25 | if cap.startswith(name_eq): |
|
23 | 26 | return cap[len(name_eq):] |
|
24 | 27 | return False |
General Comments 0
You need to be logged in to leave comments.
Login now