Renaming a directory in SVN

View: New views
2 Messages — Rating Filter:   Alert me  

Renaming a directory in SVN

by Tyler-54 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm having problems when renaming a directory and committing it. I have a post-commit hook script set up to detect any changes made in SVN and modify a shadow directory accordingly.

When I rename a directory, SVN creates a new directory with the new name and moves over the contents of the old to the new one. The old directory and its contents are then deleted during the commit.

The problem is, "svnlook changed" only sees the delete of the old directory/contents and the addition of the new directory, but none of the contents inside the new one. It seems like the contents are moved without actually being committed, so my hook script isn't aware of it.

Is there a way for a hook script to detect when a directory is renamed rather than just deleted and a new one added?

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2414223

To unsubscribe from this discussion, e-mail: [users-unsubscribe@...].

Re: Renaming a directory in SVN

by Stein Somers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Is there a way for a hook script to detect when a directory is renamed
 > rather than just deleted and a new one added?

Yes there is a way. If a directory was renamed or otherwise copied, the added
directory will be a copy of some versioned directory, not a plain addition.

What the way is, I don't know. I assume svnlook on the transaction will tell
you what path and revision the new directory is a copy of. Then you can
svnlook at that old directory to see what was inside. But then you have to
merge the contents with any changes inside the renamed directory being
committed in the same transaction. Good luck!

--
Stein

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2414398

To unsubscribe from this discussion, e-mail: [users-unsubscribe@...].