Re: svnlook changed - howto see all deleted files in pre-/post-commit hooks
From: Ryan Schmidt <subversion-2011a_at_ryandesign.com>
Date: Thu, 4 Aug 2011 02:24:41 -0500
On Aug 3, 2011, at 08:14, Jan Ciesko (GMAIL) wrote:
> I'd like to ask if there is a way to see which particular files have been deleted when a directory deletion has been commited.
There's a slight confusion in your email, in that in a post-commit hook, you would not have a transaction ($TXN); you would have a revision ($REV). In a pre-commit hook you would have a transaction.
When a commit comes in, Subversion creates a transaction, calls the pre-commit hook with that transaction to see if the commit is allowed to proceed; if it is, Subversion promotes the transaction to a revision, then calls the post-commit hook with that revision.
One way to see what's in a directory would be to use "svnlook tree $REPOS $PATH_IN_REPOS". If you're calling this from a pre-commit hook, then the directory currently still exists in the repository and you can call it just like that, which will look at the HEAD of the repository. If we're in a post-commit hook, the directory has already been deleted from the HEAD, so you would need to look at the preceding revision ($REV - 1).
This is an archived mail posted to the Subversion Users mailing list.