This fixes some exceptions in a few tests.
- skip-blame just b'' prefixes
hg-reviewers |
This fixes some exceptions in a few tests.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | tests/notcapable (2 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Gregory Szorc | Jan 22 2019, 7:54 PM |
# Disable the $CAP wire protocol capability. | # Disable the $CAP wire protocol capability. | ||||
if test -z "$CAP" | if test -z "$CAP" | ||||
then | then | ||||
echo "CAP environment variable not set." | echo "CAP environment variable not set." | ||||
fi | fi | ||||
cat > notcapable-$CAP.py << EOF | cat > notcapable-$CAP.py << EOF | ||||
from mercurial import extensions, localrepo, repository | from mercurial import extensions, localrepo, repository | ||||
def extsetup(ui): | def extsetup(ui): | ||||
extensions.wrapfunction(repository.peer, 'capable', wrapcapable) | extensions.wrapfunction(repository.peer, 'capable', wrapcapable) | ||||
extensions.wrapfunction(localrepo.localrepository, 'peer', wrappeer) | extensions.wrapfunction(localrepo.localrepository, 'peer', wrappeer) | ||||
def wrapcapable(orig, self, name, *args, **kwargs): | def wrapcapable(orig, self, name, *args, **kwargs): | ||||
if name in '$CAP'.split(' '): | if name in b'$CAP'.split(b' '): | ||||
return False | return False | ||||
return orig(self, name, *args, **kwargs) | return orig(self, name, *args, **kwargs) | ||||
def wrappeer(orig, self): | def wrappeer(orig, self): | ||||
# Since we're disabling some newer features, we need to make sure local | # Since we're disabling some newer features, we need to make sure local | ||||
# repos add in the legacy features again. | # repos add in the legacy features again. | ||||
return localrepo.locallegacypeer(self) | return localrepo.locallegacypeer(self) | ||||
EOF | EOF | ||||
echo '[extensions]' >> $HGRCPATH | echo '[extensions]' >> $HGRCPATH | ||||
echo "notcapable-$CAP = `pwd`/notcapable-$CAP.py" >> $HGRCPATH | echo "notcapable-$CAP = `pwd`/notcapable-$CAP.py" >> $HGRCPATH |