[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: [TSVN] How to make a Real Tag?

From: Lübbe Onken <l.onken_at_rac.de>
Date: 2005-09-22 09:12:35 CEST

Hi René

René Vestergaard wrote:
> I understand that, but my question was another.
>
> Is there any way to avoid/deny that
> a Tag-branches can be commit'ed to (changes that is)?
>
> One could say: "make tags readonly, after there creation".

TortoiseSVN will issue a warning if you try to commit to a tags folder
 
> Example:
> It would be very bad (bad = make the software-development unsecure),
> if I have a branch named /MyProjekt1/tags/version_1.0

That is by convention a tag...

> and someone does:
> a CheckOut,
> make some changes in the sourcecode and
> do a commit.
> This is unfortunatly possible, because the tag is really a branch.

Again: TortoiseSVN will issue a warning if you try to commit to a tags
folder :-)

If you *really* want to prevent people from committing to a tag, you have to
install a server pre-commit hook that does something like this:

---SNIP---
SVNLOOK=/usr/local/bin/svnlook
# Check for modification of tags.

# Reject tag modifications except creation and deletion
#echo "=============== changed ================" >>/tmp/pre-commit.log
$SVNLOOK changed -t "$TXN" "$REPOS" | grep "tags/" >/dev/null
if [ $? -eq 0 ] ; then
    $SVNLOOK changed -t "$TXN" "$REPOS" | egrep
"^[AD][[:space:]]+(.*/)?tags/[^/]+/$" >/dev/null
    if [ $? -ne 0 ] ; then
        echo -e "\nModifikation von Tags ist nicht zulaessig. Uebertragung
abgebrochen!\nModification of tags is not allowed. Commit aborted!" 1>&2
        exit 1
    fi
fi
---SNIP---

Cheers
- Lübbe

--
       ___
  oo  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Thu Sep 22 09:12:57 2005

This is an archived mail posted to the TortoiseSVN Dev mailing list.