Hi, We are using svn multisite and we are having hard time with the svn externals as users are adding externals with the hard coded path. So we want to do a pre commit hook to reject if the svn externals are not relative path. We found a similar one at disabling-creation-of-svn-externals-is-this-possible in the forum but the REPONAME=$(${ECHO} ${REPOS} | rev | cut -d / -f1 | rev) is not giving the path of the svn externals. Any help with this regards is very much appreciated. SVNLOOK=/usr/bin/svnlook GREP=/bin/grep PRINTF=/usr/bin/printf MKTEMP=/bin/mktemp RM=/bin/rm REPONAME=$(${ECHO} ${REPOS} | rev | cut -d / -f1 | rev) # Block all users from creating svn:externals in this repo SVN_TMP=$(${MKTEMP}) SVN_TMP_DIRS=$(${MKTEMP}) ${SVNLOOK} dirs-changed --transaction "${TXN}" "${REPOS}" > ${SVN_TMP_DIRS} while read LINE; do ${SVNLOOK} propget --verbose --transaction "${TXN}" "${REPOS}" svn:externals ${LINE} | ${GREP} -q "svn:externals" if [ $? == 0 ] ; then ${PRINTF} "\nMyCompanyName - SVN pre-commit hook message:\nThe policies of this SVN repo (${REPONAME}) prohibit the creation of svn:external properties.\n" > ${SVN_TMP} ${CAT} ${SVN_TMP} 1>&2 ${RM} -f ${SVN_TMP} ${SVN_TMP_DIRS} exit 1 fi done < ${SVN_TMP_DIRS} ${RM} -f ${SVN_TMP} ${SVN_TMP_DIRS}
Last updated