tests/notcapable
author Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
Mon, 02 May 2011 19:21:30 +0200
changeset 14163 38184a72d793
parent 14011 b69471bdb678
child 14409 9ff996ba00b4
permissions -rw-r--r--
debugbuilddag: use memctx for speed This drops the options to run arbitrary shell commands within commits and the option to create a file that gets appended to in every revision. It now supports to not write file data at all, which is very fast for generating a pure 00changelog.i (useful for discovery tests, for instance). Timings for 1000 linear nodes: * Old `hg debugbuilddag -o '+1000'` took 4.5 secs. * New `hg debugbuilddag -o '+1000'` takes 2 secs. * New `hg debugbuilddag '+1000'` takes 0.8 secs. (The last one creates only 00changelog.i).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
     9
from mercurial import extensions, repo
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    10
def extsetup():
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    11
    extensions.wrapfunction(repo.repository, 'capable', wrapper)
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    12
def wrapper(orig, self, name, *args, **kwargs):
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    13
    if name == '$CAP':
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    14
        return False
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    15
    return orig(self, name, *args, **kwargs)
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    16
EOF
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    17
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    18
echo '[extensions]' >> $HGRCPATH
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    19
echo "notcapable-$CAP = `pwd`/notcapable-$CAP.py" >> $HGRCPATH