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

Re: how to detect action of deletion?

From: SVram <malsam.v2_at_gmail.com>
Date: Tue, 24 Nov 2009 01:50:25 -0800 (PST)

VeChen wrote:
>
>>hi
>>i'm a new manager of svn ,i'm ordered to prevent users from deleting
things in the repository ,
>>I should use a pre-commit hook to solve this issues but i don't konw how
to program.
>>I think I should konw "how to detect action of deletion" first,so is there
someone can give me some >suggests,
>>thx!
>
>

Hello chen
                The question is related to server side. And one more thing
when coming to repository there is nothing like deletion, the states can
only be commited. And even if you delete a file and commit that, you will
have the file in previous revision. And related to your question

just add a line to your pre commit hooks like

svn st | grep [D\!] | cut -c 9-

This command will grep the status of the repos. If any deletion is done D/!
will be in the status and we are getting the file names which got deleted.
once you have the file names make svn revert of that file name with showing
some prompt like "you dont have permission to delete or so"

just a simple tweak will meet your requirements.

Thanks & Regards,
RAM

-- 
View this message in context: http://old.nabble.com/how-to-detect-action-of-deletion%EF%BC%9F-tp26491040p26493121.html
Sent from the tortoisesvn - users mailing list archive at Nabble.com.
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2423748
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2009-11-24 10:50:33 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.