You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Bicking, David (HHoldings, IT)" <Da...@thehartford.com> on 2007/10/16 17:32:58 UTC

Commit hook and changed properties

Hi,

I spent some time working with svnlook and a pre-commit hook batch file
looking for a way to identify changed properties.  I failed.  Rather
than waste more time, I am here to ask for a bit of help. I want to
identify properties by name that changed in value (or were added) during
the current commit transaction.  I will then take this information and
determine if the person who is committing has the right to do so.  

The pre-commit hook should be the place for the svnlook.  The problem
is, the start-commit hook is where I figure out who is doing it.  Once I
figure out how to get the list of changed properties, I'll next need to
communicate that to the next event.  I could use help with that, too.

Thanks! 
 
--
David Bicking


*************************************************************************
This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information.  If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited.  If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
*************************************************************************

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


Re: Commit hook and changed properties

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Oct 16, 2007, at 12:32, Bicking, David (HHoldings, IT) wrote:

> I spent some time working with svnlook and a pre-commit hook batch  
> file
> looking for a way to identify changed properties.  I failed.  Rather
> than waste more time, I am here to ask for a bit of help. I want to
> identify properties by name that changed in value (or were added)  
> during
> the current commit transaction.  I will then take this information and
> determine if the person who is committing has the right to do so.
>
> The pre-commit hook should be the place for the svnlook.  The problem
> is, the start-commit hook is where I figure out who is doing it.   
> Once I
> figure out how to get the list of changed properties, I'll next  
> need to
> communicate that to the next event.  I could use help with that, too.

Since the start-commit is not given any of the changes of the commit,  
and you need the changes of the commit to see the properties, you'll  
need to do all your tasks in the pre-commit hook, not the start- 
commit hook.

It doesn't seem to be easy to see the property changes. This might help:

svnlook diff $REPO -t $TXN | sed -n -e 's/^Property changes on: //p' - 
e 's/^Name: / /p'

It should give you output for example like this:

bar
  svn:keywords
foo
  svn:eol-style
  svn:mime-type


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

RE: Commit hook and changed properties

Posted by "Bicking, David (HHoldings, IT)" <Da...@thehartford.com>.
 
> -----Original Message-----
> From: Bicking, David (HHoldings, IT) 
> 
> Hi,
> 
> I spent some time working with svnlook and a pre-commit hook 
> batch file looking for a way to identify changed properties.  
> I failed.  Rather than waste more time, I am here to ask for 
> a bit of help. I want to identify properties by name that 
> changed in value (or were added) during the current commit 
> transaction.  I will then take this information and determine 
> if the person who is committing has the right to do so.  

I managed to find more information to help me with the above.  In the
pre-commit, I can use svnlook to get the user (thank goodness) and I can
also parse the "changed" output to find the paths that have property
changes.  These paths can then be put through "svnlook pl" to get the
property names that are being modified or added in the transaction.  I
can use this information to determine if the individual in question is
permitted to make those changes.

Is there an easier way?  Since I'm in a Windows environment, I'm
considering .NET console applications for the job of hook script
commands.  Would it be easier to get Python and figure it out?

--
David


*************************************************************************
This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information.  If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited.  If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
*************************************************************************

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