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.
> 
> Example:
> 
> I add to a repository BAR/Apps the folder Jacobi. With "svnlook changed 
> "$REPOS"" in the post-commit hook I get the output:
> A   BAR/Apps/Jacobi/
> A   BAR/Apps/Jacobi/LICENSE
> A   BAR/Apps/Jacobi/Makefile
> A   BAR/Apps/Jacobi/Readme
> A   BAR/Apps/Jacobi/bin/
> A   BAR/Apps/Jacobi/src/
> A   BAR/Apps/Jacobi/src/jacobi.c
> 
> On deleting the folder Jacobi from the repository and running $SVNLOOK 
> changed "$REPOS" --transaction "$TXN" I'm getting only.
> D   BAR/Apps/Jacobi/
> 
> Since I'm parsing a Readme file to update a TRAC front-end, I would very much 
> need to see the individual files that were deleted in the Jacobi folder, 
> including the Readme. Is there a way of getting this information?

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).


Reply via email to