Mercurial > hg
annotate tests/notcapable @ 33064:9062458febca
keyword: restore kwtemplater.match at the end of wrapped webcommands
Before this patch, kwweb_skip doesn't restore kwtemplater.match after
wrapped webcommands. This suppresses keyword expansion at wrapped
webcommands.
Typical usecase of this issue is "file" webcommand after annotate,
changeset, filediff or so on.
To ensure kwtemplater.match=util.never while original webcommand
running, this patch makes kwweb_skip yield values returned by it,
because it returns generator object.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Mon, 26 Jun 2017 03:40:06 +0900 |
parents | 1ac628cd7113 |
children | dedab036215d |
rev | line source |
---|---|
14011
b69471bdb678
tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff
changeset
|
1 # Disable the $CAP wire protocol capability. |
b69471bdb678
tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff
changeset
|
2 |
b69471bdb678
tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff
changeset
|
3 if test -z "$CAP" |
b69471bdb678
tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff
changeset
|
4 then |
b69471bdb678
tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff
changeset
|
5 echo "CAP environment variable not set." |
b69471bdb678
tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff
changeset
|
6 fi |
b69471bdb678
tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff
changeset
|
7 |
b69471bdb678
tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff
changeset
|
8 cat > notcapable-$CAP.py << EOF |
17192
1ac628cd7113
peer: introduce real peer classes
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14409
diff
changeset
|
9 from mercurial import extensions, peer, localrepo |
14011
b69471bdb678
tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff
changeset
|
10 def extsetup(): |
17192
1ac628cd7113
peer: introduce real peer classes
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14409
diff
changeset
|
11 extensions.wrapfunction(peer.peerrepository, 'capable', wrapcapable) |
1ac628cd7113
peer: introduce real peer classes
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14409
diff
changeset
|
12 extensions.wrapfunction(localrepo.localrepository, 'peer', wrappeer) |
1ac628cd7113
peer: introduce real peer classes
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14409
diff
changeset
|
13 def wrapcapable(orig, self, name, *args, **kwargs): |
14409
9ff996ba00b4
tests: support multiple caps in notcapable
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14011
diff
changeset
|
14 if name in '$CAP'.split(' '): |
14011
b69471bdb678
tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff
changeset
|
15 return False |
b69471bdb678
tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff
changeset
|
16 return orig(self, name, *args, **kwargs) |
17192
1ac628cd7113
peer: introduce real peer classes
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14409
diff
changeset
|
17 def wrappeer(orig, self): |
1ac628cd7113
peer: introduce real peer classes
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14409
diff
changeset
|
18 # Since we're disabling some newer features, we need to make sure local |
1ac628cd7113
peer: introduce real peer classes
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14409
diff
changeset
|
19 # repos add in the legacy features again. |
1ac628cd7113
peer: introduce real peer classes
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14409
diff
changeset
|
20 return localrepo.locallegacypeer(self) |
14011
b69471bdb678
tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff
changeset
|
21 EOF |
b69471bdb678
tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff
changeset
|
22 |
b69471bdb678
tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff
changeset
|
23 echo '[extensions]' >> $HGRCPATH |
b69471bdb678
tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff
changeset
|
24 echo "notcapable-$CAP = `pwd`/notcapable-$CAP.py" >> $HGRCPATH |