[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: Daniel Becroft <djcbecroft_at_gmail.com>
Date: Wed, 25 Nov 2009 08:18:40 +1000

On Tue, Nov 24, 2009 at 7:50 PM, SVram <malsam.v2_at_gmail.com> wrote:
> 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 won't work. 'svn status' is designed to show the status of a
working copy relative to it's BASE. It will not show you the details
of a commit that is in process (which is what is required).

The command that you need is 'svnlook changed --transaction'. This
gives an output similar to (if not identical to) that of 'svn status'.
A 'D' in the first column indicates a deletion.

Further information on 'svnlook' can be found here:
http://svnbook.red-bean.com/nightly/en/svn.ref.svnlook.html

> 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"

Again, this is not correct. 'svn revert' again requires access to a
working copy - it does not work on a repository. The only way this
would work is if you had access to the working copy being committed
from (which is, again, virtually impossible).

Regards,
Daniel B.

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2423988

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2009-11-24 23:19:06 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.