##// END OF EJS Templates
tests: rely on dummyssh being the default...
tests: rely on dummyssh being the default This commit is exactly the result of running this command: sed -i -e 's! *\(-e \|--ssh \|--config ui.ssh=\)[ \"]*$PYTHON[ \"]*$\(RUN\|\)TESTDIR/dummyssh[\"]* *! !g' -e '/^[ >]*ssh *=[ "]*$PYTHON[ "]*$\(RUN\|\)TESTDIR\/dummyssh[ "]*$/d' -e 's/^\( [$] .*[^ ]\) *$/\1/' *.t *.sh Sometimes the tests can be simplified further, but I think it's preferable to do the simplification separately. Differential Revision: https://phab.mercurial-scm.org/D11245

File last commit:

r48732:9c4204b7 default
r48732:9c4204b7 default
Show More
test-missing-capability.t
45 lines | 1.3 KiB | text/troff | Tads3Lexer
/ tests / test-missing-capability.t
Checking how hg behaves when one side of a pull/push doesn't support
some capability (because it's running an older hg version, usually).
$ hg init repo1
$ cd repo1
$ echo a > a; hg add -q a; hg commit -q -m a
$ hg bookmark a
$ hg clone -q . ../repo2
$ cd ../repo2
$ touch $TESTTMP/disable-lookup.py
$ disable_cap() {
> rm -f $TESTTMP/disable-lookup.pyc # pyc caching is buggy
> cat <<EOF > $TESTTMP/disable-lookup.py
> from mercurial import extensions, wireprotov1server
> def wcapabilities(orig, *args, **kwargs):
> cap = orig(*args, **kwargs)
> cap.remove(b'$1')
> return cap
> extensions.wrapfunction(wireprotov1server, '_capabilities', wcapabilities)
> EOF
> }
$ cat >> ../repo1/.hg/hgrc <<EOF
> [extensions]
> disable-lookup = $TESTTMP/disable-lookup.py
> EOF
$ cat >> .hg/hgrc <<EOF
> [ui]
> EOF
$ hg pull ssh://user@dummy/repo1 -r tip -B a
pulling from ssh://user@dummy/repo1
no changes found
$ disable_cap lookup
$ hg pull ssh://user@dummy/repo1 -r tip -B a
pulling from ssh://user@dummy/repo1
abort: other repository doesn't support revision lookup, so a rev cannot be specified.
[255]
$ disable_cap pushkey
$ hg pull ssh://user@dummy/repo1 -r tip -B a
pulling from ssh://user@dummy/repo1
abort: remote bookmark a not found!
[10]