You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ronny Schuetz <us...@groombridge34.de> on 2005/06/01 10:28:26 UTC

How to distinguish between a newly added file and a copied/moved file in the pre-commit hook?

Hi,

I wrote a pre-commit hook to validate the properties of newly added
files to make sure the users are using the config file (with enabled
auto-props) I sent out previously. I don't want to validate the
properties if the files was already in the repository.

Unfortunately, I did not found a way to distinguish between new files
added to the repository and files just being renamed or copied in the
repository, where the properties are kept anyway.

Is there any way to get this information from a pre-commit hook?

Thanks in advance,
Best regards,
Ronny


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: How to distinguish between a newly added file and a copied/moved file in the pre-commit hook?

Posted by Scott Palmer <sc...@2connected.org>.
On Jun 1, 2005, at 8:13 AM, Greg Thomas wrote:

> On Wed, 01 Jun 2005 12:28:26 +0200, Ronny Schuetz
> <us...@groombridge34.de> wrote:
>
>
>> Is there any way to get this information from a pre-commit hook?
>>
>
> svnlook changed will show D for deleted files, and A for added files.
> As a rename is a D followed by an A, you'll need to search all A files
> to see if there is a corresponding D file. If there is, you can skip
> the check.

Just curious.. if it's a rename, how do you know if the 'D file' is  
corresponding to the 'A file' or not?  Presumably the paths are  
different so there must be something else to 'link' them.

Scott


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: How to distinguish between a newly added file and a copied/moved file in the pre-commit hook?

Posted by Greg Thomas <th...@omc.bt.co.uk>.
On Wed, 01 Jun 2005 13:13:49 +0100, Greg Thomas
<th...@omc.bt.co.uk> wrote:

>On Wed, 01 Jun 2005 12:28:26 +0200, Ronny Schuetz
><us...@groombridge34.de> wrote:
>
>>Is there any way to get this information from a pre-commit hook?
>
>svnlook changed will show D for deleted files, and A for added files.
>As a rename is a D followed by an A, you'll need to search all A files
>to see if there is a corresponding D file. If there is, you can skip
>the check.

Doh! On reflection, there's no easy way to tie the two together that I
can think of - you won't know if it's a rename or a genuine
delete/add.

>Or, just run the check, anyway, and don't worry about it. 

Which definitely sounds like the best way forward!

Greg
-- 
This post represents the views of the author and does
not necessarily accurately represent the views of BT.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: How to distinguish between a newly added file and a copied/moved file in the pre-commit hook?

Posted by Greg Thomas <th...@omc.bt.co.uk>.
On Wed, 01 Jun 2005 12:28:26 +0200, Ronny Schuetz
<us...@groombridge34.de> wrote:

>Is there any way to get this information from a pre-commit hook?

svnlook changed will show D for deleted files, and A for added files.
As a rename is a D followed by an A, you'll need to search all A files
to see if there is a corresponding D file. If there is, you can skip
the check.

Or, just run the check, anyway, and don't worry about it. 

Greg
-- 
This post represents the views of the author and does
not necessarily accurately represent the views of BT.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org