Mercurial > hg
comparison mercurial/localrepo.py @ 20776:d00c731f4637
localrepo: rename capability set to lower case.
This is not C and they are not even constant.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 14 Mar 2014 00:02:05 -0700 |
parents | efbf15979538 |
children | ca5dd216cb62 |
comparison
equal
deleted
inserted
replaced
20775:982f13bef503 | 20776:d00c731f4637 |
---|---|
60 """decorate method that always need to be run on unfiltered version""" | 60 """decorate method that always need to be run on unfiltered version""" |
61 def wrapper(repo, *args, **kwargs): | 61 def wrapper(repo, *args, **kwargs): |
62 return orig(repo.unfiltered(), *args, **kwargs) | 62 return orig(repo.unfiltered(), *args, **kwargs) |
63 return wrapper | 63 return wrapper |
64 | 64 |
65 MODERNCAPS = set(('lookup', 'branchmap', 'pushkey', 'known', 'getbundle')) | 65 moderncaps = set(('lookup', 'branchmap', 'pushkey', 'known', 'getbundle')) |
66 LEGACYCAPS = MODERNCAPS.union(set(['changegroupsubset'])) | 66 legacycaps = moderncaps.union(set(['changegroupsubset'])) |
67 | 67 |
68 class localpeer(peer.peerrepository): | 68 class localpeer(peer.peerrepository): |
69 '''peer for a local repo; reflects only the most recent API''' | 69 '''peer for a local repo; reflects only the most recent API''' |
70 | 70 |
71 def __init__(self, repo, caps=MODERNCAPS): | 71 def __init__(self, repo, caps=moderncaps): |
72 peer.peerrepository.__init__(self) | 72 peer.peerrepository.__init__(self) |
73 self._repo = repo.filtered('served') | 73 self._repo = repo.filtered('served') |
74 self.ui = repo.ui | 74 self.ui = repo.ui |
75 self._caps = repo._restrictcapabilities(caps) | 75 self._caps = repo._restrictcapabilities(caps) |
76 self.requirements = repo.requirements | 76 self.requirements = repo.requirements |
129 class locallegacypeer(localpeer): | 129 class locallegacypeer(localpeer): |
130 '''peer extension which implements legacy methods too; used for tests with | 130 '''peer extension which implements legacy methods too; used for tests with |
131 restricted capabilities''' | 131 restricted capabilities''' |
132 | 132 |
133 def __init__(self, repo): | 133 def __init__(self, repo): |
134 localpeer.__init__(self, repo, caps=LEGACYCAPS) | 134 localpeer.__init__(self, repo, caps=legacycaps) |
135 | 135 |
136 def branches(self, nodes): | 136 def branches(self, nodes): |
137 return self._repo.branches(nodes) | 137 return self._repo.branches(nodes) |
138 | 138 |
139 def between(self, pairs): | 139 def between(self, pairs): |