tests/library-infinitepush.sh
author Pierre-Yves David <pierre-yves.david@octobus.net>
Mon, 14 Sep 2020 23:47:42 +0200
changeset 45662 64a4b85c4a00
parent 37189 03ff17a4bf53
child 46226 0826d684a1b5
permissions -rw-r--r--
salvaged: record salvaged in ChangingFiles at commit time The new code is a simple but effective way to detect this information. We might be able to move it inside the various conditionnal above, but I want to focus on simplicity until we have a full working stack. It is worth noting that if we record the information in the ChangingFiles object, it is not persisted yet. This will comes with later changesets. Differential Revision: https://phab.mercurial-scm.org/D9120

scratchnodes() {
  for node in `find ../repo/.hg/scratchbranches/index/nodemap/* | sort`; do
     echo ${node##*/} `cat $node`
  done
}

scratchbookmarks() {
  for bookmark in `find ../repo/.hg/scratchbranches/index/bookmarkmap/* -type f | sort`; do
     echo "${bookmark##*/bookmarkmap/} `cat $bookmark`"
  done
}

setupcommon() {
  cat >> $HGRCPATH << EOF
[extensions]
infinitepush=
[ui]
ssh = python "$TESTDIR/dummyssh"
[infinitepush]
branchpattern=re:scratch/.*
EOF
}

setupserver() {
cat >> .hg/hgrc << EOF
[infinitepush]
server=yes
indextype=disk
storetype=disk
reponame=babar
EOF
}

waitbgbackup() {
  sleep 1
  hg debugwaitbackup
}

mkcommitautobackup() {
    echo $1 > $1
    hg add $1
    hg ci -m $1 --config infinitepushbackup.autobackup=True
}

setuplogdir() {
  mkdir $TESTTMP/logs
  chmod 0755 $TESTTMP/logs
  chmod +t $TESTTMP/logs
}