I am trying to implement a soft lock system, where we will have a password we send people before submitting.
This kind of works if people pass the password on the submit, but then everyone sees the password.
What for now is ok, as this is more a reminder.
But what if I wanted to ask the client for the password, and allow them to write it on a prompt in p4 view?
I tried setting this change=submit trigger
This works, but I want a prompt on P4V (the perforce visual client)
#!/bin/bash
# The correct password
CORRECT_PASSWORD="TrustMe"
# Extract the changelist number from the arguments
CHANGE_LIST=$1
# Get the description of the changelist
DESCRIPTION=$(p4 describe -s "$CHANGE_LIST" | awk 'BEGIN {found=0} /^t/ {found=1} {if (found) print}' | tr -d 't')
# Extract the password from the description
PASSWORD=$(echo "$DESCRIPTION" | grep -o "[pass=[^]]*]" | sed 's/[pass=(.*)]/1/')
# Check if the extracted password matches the correct password
if [ "$PASSWORD" != "$CORRECT_PASSWORD" ]; then
echo "Password incorrect. Submit aborted."
exit 1
fi
exit 0