#!/bin/bash
#------------------------------------------------------------------------------
set -u

declare Job=
declare OldReleaseCL=

function msg () { echo -e "$*"; }

# Run this from //p4-hms/dev steam workspace in the tools directory.
#
# You must have a valid ticket.

# shellcheck disable=SC1091
source ./env.sh
OldReleaseCL=$(p4 print -q //p4-hms/main/p4/common/site/hms/Version |cut -d '/' -f 4|cut -d ' ' -f 1)

msg "Jobs fixed since $OldReleaseCL:"

for Job in $(p4 -ztag -F %Job% fixes //p4-hms/dev...@$((OldReleaseCL+1)),@now | sort -u); do
   gjh.sh "$Job"
done

msg "\n"
