tests/library-infinitepush.sh
author Aay Jay Chan <aayjaychan@itopia.com.hk>
Tue, 18 Aug 2020 22:21:00 +0800
changeset 45391 8b700e9b9fc2
parent 37187 03ff17a4bf53
child 46226 0826d684a1b5
permissions -rw-r--r--
hooklib: update documentation of changeset_obsoletedfor for changed hook type This updates usage example of changeset_obsoleted to reflect the move from pretxnclose to txnclose made in 04ef381000a8 (hooklib: fix detection of successors for changeset_obsoleted). Differential Revision: https://phab.mercurial-scm.org/D8929

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
}