Skip to content
suit Artifact [6abba00d2f]
Login

Artifact [6abba00d2f]

Artifact 6abba00d2f89fe2fe9f6246831922ccd28753e5085b28317d67d54bd30833706:


#!/bin/sh
# Rebuilds the Fossil project fixture in test/fixtures/fossil-project/ with
# stock fossil and the sqlite3 shell: ckout.db is a checkout's .fslckout (the
# test copies it to a folder as .fslckout; a file of that name is not kept in a
# Fossil repository) and repo.fossil is the repository it names, as
# "../repo.fossil", with a last-sync-url that has a user name, an upper-case
# host and a trailing slash. Checked in, so the project tests run on machines
# without fossil; this script only exists to remake them.
set -eu
out=$(cd "${1:-test/fixtures/fossil-project}" && pwd)
work=$(mktemp -d "${TMPDIR:-/tmp}/suit-fixture.XXXXXX")
trap 'rm -rf "$work"' EXIT INT TERM
fossil new --admin-user fixture "$work/repo.fossil" >/dev/null
mkdir "$work/co" && cd "$work/co"
fossil open ../repo.fossil >/dev/null
sqlite3 "$work/repo.fossil" "INSERT OR REPLACE INTO config(name, value, mtime) VALUES ('last-sync-url', 'https://[email protected]/r/owner/wardrobe/', 0)"
sqlite3 "$work/repo.fossil" "VACUUM"
cp "$work/repo.fossil" "$out/repo.fossil"
cp "$work/co/.fslckout" "$out/ckout.db"