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