comparison tests/notcapable @ 42813:268662aac075

interfaces: create a new folder for interfaces and move repository.py in it I was trying to understand current interfaces and write new ones and I realized we need to improve how current interfaces are organised. This creates a dedicated folder for defining interfaces and move `repository.py` which defines all the current interfaces inside it. Differential Revision: https://phab.mercurial-scm.org/D6741
author Pulkit Goyal <pulkit@yandex-team.ru>
date Sun, 18 Aug 2019 00:45:33 +0300
parents 15fd3069caa6
children ff7134e03629
comparison
equal deleted inserted replaced
42807:383fdfa6bba9 42813:268662aac075
4 then 4 then
5 echo "CAP environment variable not set." 5 echo "CAP environment variable not set."
6 fi 6 fi
7 7
8 cat > notcapable-$CAP.py << EOF 8 cat > notcapable-$CAP.py << EOF
9 from mercurial import extensions, localrepo, repository 9 from mercurial import extensions, localrepo
10 from mercurial.interfaces import repository
10 def extsetup(ui): 11 def extsetup(ui):
11 extensions.wrapfunction(repository.peer, 'capable', wrapcapable) 12 extensions.wrapfunction(repository.peer, 'capable', wrapcapable)
12 extensions.wrapfunction(localrepo.localrepository, 'peer', wrappeer) 13 extensions.wrapfunction(localrepo.localrepository, 'peer', wrappeer)
13 def wrapcapable(orig, self, name, *args, **kwargs): 14 def wrapcapable(orig, self, name, *args, **kwargs):
14 if name in b'$CAP'.split(b' '): 15 if name in b'$CAP'.split(b' '):