Mercurial > hg
diff tests/remotefilelog-library.sh @ 40495:3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
This is remotefilelog as of my recent patches for compatibility with
current tip of hg, minus support for old versions of Mercurial and
some FB-specific features like their treemanifest extension and
fetching linkrev data from a patched phabricator. The file extutil.py
moved from hgext3rd to remotefilelog.
This is not yet ready to be landed, consider it a preview for
now. Planned changes include:
* replace lz4 with zstd
* rename some capabilities, requirements and wireproto commands to mark
them as experimental
* consolidate bits of shallowutil with related functions (eg readfile)
I'm certainly open to other (small) changes, but my rough mission is
to land this largely as-is so we can use it as a model of the
functionality we need going forward for lazy-fetching of file contents
from a server.
# no-check-commit because of a few foo_bar functions
Differential Revision: https://phab.mercurial-scm.org/D4782
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 27 Sep 2018 13:03:19 -0400 |
parents | |
children | 67e35dceab9b |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/remotefilelog-library.sh Thu Sep 27 13:03:19 2018 -0400 @@ -0,0 +1,88 @@ +${PYTHON:-python} -c 'import lz4' || exit 80 + +CACHEDIR=$PWD/hgcache +cat >> $HGRCPATH <<EOF +[remotefilelog] +cachepath=$CACHEDIR +debug=True +historypackv1=True +datapackversion=1 +[extensions] +remotefilelog= +rebase= +mq= +[ui] +ssh=python "$TESTDIR/dummyssh" +[server] +preferuncompressed=True +[experimental] +changegroup3=True +[rebase] +singletransaction=True +EOF + +hgcloneshallow() { + local name + local dest + orig=$1 + shift + dest=$1 + shift + hg clone --shallow --config remotefilelog.reponame=master $orig $dest $@ + cat >> $dest/.hg/hgrc <<EOF +[remotefilelog] +reponame=master +datapackversion=1 +[phases] +publish=False +EOF +} + +hgcloneshallowlfs() { + local name + local dest + local lfsdir + orig=$1 + shift + dest=$1 + shift + lfsdir=$1 + shift + hg clone --shallow --config "extensions.lfs=" --config "lfs.url=$lfsdir" --config remotefilelog.reponame=master $orig $dest $@ + cat >> $dest/.hg/hgrc <<EOF +[extensions] +lfs= +[lfs] +url=$lfsdir +[remotefilelog] +reponame=master +datapackversion=1 +[phases] +publish=False +EOF +} + +hginit() { + local name + name=$1 + shift + hg init $name $@ +} + +clearcache() { + rm -rf $CACHEDIR/* +} + +mkcommit() { + echo "$1" > "$1" + hg add "$1" + hg ci -m "$1" +} + +ls_l() { + $PYTHON $TESTDIR/ls-l.py "$@" +} + +identifyrflcaps() { + xargs -n 1 echo | egrep '(remotefilelog|getflogheads|getfile)' | sort +}