view hg-web/repository_sync_test.sh @ 279:b3b547563ec7

Add Google connector service and agent wiki Implement the C/Seobeo Google Drive and Gmail connector with encrypted OAuth storage, Zenbu authentication, browser testing, AI tool discovery, chunked HTTP decoding, and Bazel coverage. Consolidate repository guidance into progressive wiki documentation and enforce arena-first allocation for new first-party C code. Co-authored-by: Copilot <[email protected]> Copilot-Session: 84c338fd-0939-4bb3-b7f3-1062eb213e5d
author MrJuneJune <me@mrjunejune.com>
date Mon, 17 Aug 2026 22:22:36 -0700
parents c5129452493e
children
line wrap: on
line source

#!/usr/bin/env bash
set -Eeuo pipefail

if [[ -n "${RUNFILES_DIR:-}" ]]; then
  source "$RUNFILES_DIR/bazel_tools/tools/bash/runfiles/runfiles.bash"
elif [[ -n "${RUNFILES_MANIFEST_FILE:-}" ]]; then
  runfiles_library="$(
    grep -sm1 '^bazel_tools/tools/bash/runfiles/runfiles.bash ' \
      "$RUNFILES_MANIFEST_FILE" | cut -d' ' -f2-
  )"
  source "$runfiles_library"
else
  echo "Bazel runfiles are unavailable." >&2
  exit 1
fi

hg_binary="$(rlocation _main/third_party/mercurial/runtime/bin/hg)"
root="${TEST_TMPDIR:?}/repository-sync"
source_repository="$root/source"
production_repository="$root/production"
bundle="$root/workspace.hg"
mkdir -p "$root"

HGRCPATH= "$hg_binary" init "$source_repository"
printf 'base\n' > "$source_repository/file.txt"
HGRCPATH= "$hg_binary" --cwd "$source_repository" add file.txt
HGRCPATH= "$hg_binary" --cwd "$source_repository" \
  commit -u test -m base

HGRCPATH= "$hg_binary" clone \
  "$source_repository" "$production_repository"

printf 'workspace\n' >> "$source_repository/file.txt"
HGRCPATH= "$hg_binary" --cwd "$source_repository" \
  commit -u test -m workspace

printf 'production\n' >> "$production_repository/file.txt"
HGRCPATH= "$hg_binary" --cwd "$production_repository" \
  commit -u test -m production

HGRCPATH= "$hg_binary" --repository "$source_repository" \
  bundle --all "$bundle"
HGRCPATH= "$hg_binary" --repository "$production_repository" \
  pull "$bundle"

descriptions="$(
  HGRCPATH= "$hg_binary" --repository "$production_repository" \
    log -T '{desc}\n'
)"
grep -qx workspace <<<"$descriptions"
grep -qx production <<<"$descriptions"
[[ "$(
  HGRCPATH= "$hg_binary" --repository "$production_repository" \
    heads -T '.'
)" == ".." ]]