tests/remotefilelog-library.sh
author Raphaël Gomès <rgomes@octobus.net>
Wed, 04 May 2022 18:00:01 +0200
branchstable
changeset 49161 0ddd5e1f5f67
parent 47921 0c92cd9286ee
child 50725 7e5be4a7cda7
permissions -rw-r--r--
ci: remove py2-rust support Nobody cares about this very narrow usecase, and py2 support is over by July 1st. This helps with the CI load, and removes some flakiness.

CACHEDIR=$PWD/hgcache
cat >> $HGRCPATH <<EOF
[remotefilelog]
cachepath=$CACHEDIR
debug=True
[extensions]
remotefilelog=
rebase=
strip=
[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
[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
[phases]
publish=False
EOF
}

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
}