Mercurial > hg
view tests/test-remotefilelog-pull-noshallow.t @ 42143:29569f2db929
bundle2: handle compression in _forwardchunks
_forwardchunks is used to compensate for getbundle protocol deficits.
Since it transparently decodes the payload, it also needs to remove the
corresponding compression parameter in case the server decides to send
one. This the wire protocol part of issue 5990.
Differential Revision: https://phab.mercurial-scm.org/D6182
author | Joerg Sonnenberger <joerg@bec.de> |
---|---|
date | Tue, 02 Apr 2019 19:48:31 +0200 |
parents | 52fbf8a9907c |
children |
line wrap: on
line source
#require no-windows $ . "$TESTDIR/remotefilelog-library.sh" Set up an extension to make sure remotefilelog clientsetup() runs unconditionally even if we have never used a local shallow repo. This mimics behavior when using remotefilelog with chg. clientsetup() can be triggered due to a shallow repo, and then the code can later interact with non-shallow repositories. $ cat > setupremotefilelog.py << EOF > from mercurial import extensions > def extsetup(ui): > remotefilelog = extensions.find(b'remotefilelog') > remotefilelog.onetimeclientsetup(ui) > EOF Set up the master repository to pull from. $ hg init master $ cd master $ cat >> .hg/hgrc <<EOF > [remotefilelog] > server=True > EOF $ echo x > x $ hg commit -qAm x $ cd .. $ hg clone ssh://user@dummy/master child -q We should see the remotefilelog capability here, which advertises that the server supports our custom getfiles method. $ cd master $ echo 'hello' | hg -R . serve --stdio | grep capa | identifyrflcaps exp-remotefilelog-ssh-getfiles-1 x_rfl_getfile x_rfl_getflogheads $ echo 'capabilities' | hg -R . serve --stdio | identifyrflcaps ; echo exp-remotefilelog-ssh-getfiles-1 x_rfl_getfile x_rfl_getflogheads Pull to the child repository. Use our custom setupremotefilelog extension to ensure that remotefilelog.onetimeclientsetup() gets triggered. (Without using chg it normally would not be run in this case since the local repository is not shallow.) $ echo y > y $ hg commit -qAm y $ cd ../child $ hg pull --config extensions.setuprfl=$TESTTMP/setupremotefilelog.py pulling from ssh://user@dummy/master searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets d34c38483be9 (run 'hg update' to get a working copy) $ hg up 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat y y Test that bundle works in a non-remotefilelog repo w/ remotefilelog loaded $ echo y >> y $ hg commit -qAm "modify y" $ hg bundle --base ".^" --rev . mybundle.hg --config extensions.setuprfl=$TESTTMP/setupremotefilelog.py 1 changesets found $ cd ..