You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Nathan Nobbe <qu...@gmail.com> on 2008/02/28 05:46:13 UTC

pre-revprop-change

hello all,

i am trying to set the svn:eol-style property on a repository of mine and
starting to loose hair as a consequence of this error message:

svn: DAV request failed; it's possible that the repository's
pre-revprop-change hook either failed or is non-existent
svn: At least one property change failed; repository is unchanged

ive searched the archives and read the manual on setting the property and
the hook scripts.
i should be on the right track, but something still isnt copacetic.
for property changes, you must have a hook defined, otherwise svn will act
as if the hook failed every time.
fair enough, so what ive done is defined the hook by removing the .tmpl
extension on the template file that ships w/ the repo.
and the script is executable as well,
-rwxr-xr-x 1 apache apache 58 Feb 28 00:39
/moxune/repository/hooks/pre-revprop-change

great, so im still getting the error message.
to rule out the latter part of the message, namely does the script exist, i
have added some trivial logging to the script,
which is writing out to the target file, indicating the script not only
exists, but svn is successfully invoking it.
and for the former part of the message, is the script failing, well all its
doing is echoing a string to a file and calling exit 0 so i dont think its
failing.
here is my hook script

#!/bin/sh
echo 'called me' >> /home/nathan/imCrazy
exit 0

and as i said, 'called me' is getting written to /home/nathan/imCrazy; twice
actually (dont know why)
i dont know how i could write any more trivial of a hook script.  afaict,
this should be returning successfully to the caller and the property should
be getting set in the repository.
here is the command im using to invoke the property change

svn propset eol:style --revprop -r HEAD native
https://dev.moxune.com/svn/repos/sentinelWorking/branches/sentinel_v1.2/code

thanks in advance,

-nathan

RE: Re: Re: pre-revprop-change

Posted by "Reedick, Andrew" <jr...@ATT.COM>.

> -----Original Message-----
> From: Nick.Thompson@infineon.com [mailto:Nick.Thompson@infineon.com]
> Sent: Thursday, February 28, 2008 11:39 AM
> To: quickshiftin@gmail.com; Reedick, Andrew
> Cc: users@subversion.tigris.org
> Subject: RE: Re: Re: pre-revprop-change
> 
> 
> We simply stop commits (pre-commit check) of files that don't meet our
> formating rules.
> 
> Eventually the users learn ;-)

It would be really spiffy if the pre-commit hook sent the 'svn propset'
commands in an email, created the script for them, or printed a website
link detailing what needs to be done (svn propset, update/download
subversion config file, etc.)



*****

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. GA623



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


RE: Re: Re: pre-revprop-change

Posted by Ni...@infineon.com.
	From: Nathan Nobbe [mailto:quickshiftin@gmail.com] 
	Sent: 28 February 2008 15:49
	

	im thankful for the replies from everyone.
	however i am not happy with the picture thats being painted.
	it seems to me, id be better off to create a post-commit hook
that simply runs dos2unix or something similar.
	can anyone argue against that ?
	
	-nathan
	

Never change files in a pre-commit hook, since that would leave you WC
and Repo in disagreement with each other over what is in a revision. Not
good.

In theory, you could do it in a post-commit hook as you said, but you
will end up with a lot of extra revisions.

We simply stop commits (pre-commit check) of files that don't meet our
formating rules.

Eventually the users learn ;-)

Nick.


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


Re: Re: pre-revprop-change

Posted by Nathan Nobbe <qu...@gmail.com>.
On Thu, Feb 28, 2008 at 10:12 AM, Reedick, Andrew <jr...@att.com> wrote:

>
>
> > From: Nathan Nobbe [mailto:quickshiftin@gmail.com]
> > Sent: Thursday, February 28, 2008 9:54 AM
> > To: Ryan Schmidt
> > Cc: subversion-users
> > Subject: Re: pre-revprop-change
> >
> >
> > i dont see anything here that specifically says, svn:eol-style
> > cannot be used as a revision property
> > http://svnbook.red-bean.com/en/1.0/ch07s02.html
>
> Even if you add it as a revision property, I doubt it would have any
> effect on anything.
>
>
> > i must have some disconnect regarding usage of these
> > properties.. is there no way to say, i want all files
> > in this repository, beneath this directory to have their
> > eol managed by the subversion?
>
> Checkout the dir in question and run 'svn setprop svn:eol-style native' on
> the desired files, followed by a check-in.
>
> It would be nice to have a 'svn propset' that works on URLs (with an
> implicit commit) in much the same way that 'svn mv' or 'svn copy' do.
>
>
> > what about new files?  if i create a  file and add it to
> > the repository, without specifying the svn:eol-style
> > property on it, will the eol style on the file not be
> > managed by the repository?  thats ridiculous, considering
> > users may be creating files on their own..  that's asking
> > users to get involved in administration tasks; eww.
>
> You can set the config file in ~/subversion/.config or
> %userprofile%\application data\subversion\config to automatically set the
> svn:eol-style for _newly_ created files.
>
> However, it's left as an exercise to the reader to actually push a
> standardized config file to all your subversion clients.  So you might want
> to make friends with your unix/windows system admin.  =/


im thankful for the replies from everyone.
however i am not happy with the picture thats being painted.
it seems to me, id be better off to create a post-commit hook that simply
runs dos2unix or something similar.
can anyone argue against that ?

-nathan

RE: Re: pre-revprop-change

Posted by "Reedick, Andrew" <jr...@ATT.COM>.

> From: Nathan Nobbe [mailto:quickshiftin@gmail.com] 
> Sent: Thursday, February 28, 2008 9:54 AM
> To: Ryan Schmidt
> Cc: subversion-users
> Subject: Re: pre-revprop-change
>
>
> i dont see anything here that specifically says, svn:eol-style
> cannot be used as a revision property
> http://svnbook.red-bean.com/en/1.0/ch07s02.html
 
Even if you add it as a revision property, I doubt it would have any effect on anything.


> i must have some disconnect regarding usage of these 
> properties.. is there no way to say, i want all files 
> in this repository, beneath this directory to have their 
> eol managed by the subversion?

Checkout the dir in question and run 'svn setprop svn:eol-style native' on the desired files, followed by a check-in.

It would be nice to have a 'svn propset' that works on URLs (with an implicit commit) in much the same way that 'svn mv' or 'svn copy' do.


> what about new files?  if i create a  file and add it to 
> the repository, without specifying the svn:eol-style 
> property on it, will the eol style on the file not be 
> managed by the repository?  thats ridiculous, considering 
> users may be creating files on their own..  that’s asking 
> users to get involved in administration tasks; eww.

You can set the config file in ~/subversion/.config or %userprofile%\application data\subversion\config to automatically set the svn:eol-style for _newly_ created files.

However, it's left as an exercise to the reader to actually push a standardized config file to all your subversion clients.  So you might want to make friends with your unix/windows system admin.  =/



*****

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. GA621



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


Re: pre-revprop-change

Posted by Nathan Nobbe <qu...@gmail.com>.
On Thu, Feb 28, 2008 at 5:46 PM, Ryan Schmidt <
subversion-2008a@ryandesign.com> wrote:

> There's also nothing there that says svn:eol-style cannot be used to
> bring about world peace but I don't think it would help that
> either. :) Do note that you're looking at the obsolete version of the
> book for Subversion 1.0. This is the book for Subversion 1.4 which I
> think separates the two types of properties better:
>
> http://svnbook.red-bean.com/en/1.4/svn.ref.properties.html
>

well that does clarify it quite a bit.

Without commenting on whether or not it's ridiculous, the solution we
> have today is:
>
> 1) Set up auto-props in the Subversion config file on each client
> according to the rules of your organization. For example, if you want
> all .txt files to have svn:eol-style set to native, add an auto-props
> rule "*.txt = svn:eol-style=native".
>
> 2) Install a pre-commit hook in the repository which rejects the
> commit of any file that does not conform to your rules. In the error
> message that such a hook prints, you can do whatever you like, for
> example direct users to a web site where they can download a pre-made
> config file that's set up the way you want your users to set things up.


maybe i overreacted a bit; its that 2am and i still havent got it stress :D
anyway, ill probly look into a solution similar to the one you described
above.

thanks,

-nathan

Re: pre-revprop-change

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Feb 28, 2008, at 08:53, Nathan Nobbe wrote:

> On Thu, Feb 28, 2008 at 2:36 AM, Ryan Schmidt wrote:
>
>> First of all, it's called "svn:eol-style" (not "eol:style").
>
> good catch there.
>
>> Second, it's a file property, not a revision property. You do not
>> need a pre-revprop-change hook, because you're not going to be
>> changing a revision property.
>
> i dont see anything here that specifically says, svn:eol-style
> cannot be used as a revision property
> http://svnbook.red-bean.com/en/1.0/ch07s02.html

There's also nothing there that says svn:eol-style cannot be used to  
bring about world peace but I don't think it would help that  
either. :) Do note that you're looking at the obsolete version of the  
book for Subversion 1.0. This is the book for Subversion 1.4 which I  
think separates the two types of properties better:

http://svnbook.red-bean.com/en/1.4/svn.ref.properties.html

Some of the built-in Subversion properties only work as revision  
properties. The others only work as versioned properties. None of  
them work as both.

>> Go to a working copy and set the svn:eol-style property of the file
>> whose line endings you want to specify. For example:
>>
>> cd working-copy
>> svn propset svn:eol-style native foo.txt
>> svn ci -m "foo.txt: setting svn:eol-style to native"
>
> i must have some disconnect regarding usage of these properties..
> is there no way to say, i want all files in this repository,  
> beneath this
> directory to have their eol managed by the subversion?

Not by setting just one property, no.

> what about new files?  if i create a  file and add it to the  
> repository,
> without specifying the svn:eol-style property on it, will the eol  
> style
> on the file not be managed by the repository?

Nope.

> thats ridiculous,
> considering users may be creating files on their own..  thats
> asking users to get involved in administration tasks; eww.

Without commenting on whether or not it's ridiculous, the solution we  
have today is:

1) Set up auto-props in the Subversion config file on each client  
according to the rules of your organization. For example, if you want  
all .txt files to have svn:eol-style set to native, add an auto-props  
rule "*.txt = svn:eol-style=native".

2) Install a pre-commit hook in the repository which rejects the  
commit of any file that does not conform to your rules. In the error  
message that such a hook prints, you can do whatever you like, for  
example direct users to a web site where they can download a pre-made  
config file that's set up the way you want your users to set things up.


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

Re: pre-revprop-change

Posted by Nathan Nobbe <qu...@gmail.com>.
On Thu, Feb 28, 2008 at 2:36 AM, Ryan Schmidt <
subversion-2008a@ryandesign.com> wrote:

> First of all, it's called "svn:eol-style" (not "eol:style").
>

good catch there.


> Second, it's a file property, not a revision property. You do not
> need a pre-revprop-change hook, because you're not going to be
> changing a revision property.


i dont see anything here that specifically says, svn:eol-style
cannot be used as a revision property
http://svnbook.red-bean.com/en/1.0/ch07s02.html


> Go to a working copy and set the svn:eol-style property of the file
> whose line endings you want to specify. For example:
>
> cd working-copy
> svn propset svn:eol-style native foo.txt
> svn ci -m "foo.txt: setting svn:eol-style to native"


i must have some disconnect regarding usage of these properties..
is there no way to say, i want all files in this repository, beneath this
directory to have their eol managed by the subversion?
what about new files?  if i create a  file and add it to the repository,
without specifying the svn:eol-style property on it, will the eol style
on the file not be managed by the repository?  thats ridiculous,
considering users may be creating files on their own..  thats
asking users to get involved in administration tasks; eww.

-nathan

Re: pre-revprop-change

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Feb 27, 2008, at 23:46, Nathan Nobbe wrote:

> i am trying to set the svn:eol-style property on a repository of  
> mine and starting to loose hair as a consequence of this error  
> message:
>
> svn: DAV request failed; it's possible that the repository's pre- 
> revprop-change hook either failed or is non-existent
> svn: At least one property change failed; repository is unchanged
>
> ive searched the archives and read the manual on setting the  
> property and the hook scripts.
> i should be on the right track, but something still isnt copacetic.
> for property changes, you must have a hook defined, otherwise svn  
> will act as if the hook failed every time.
> fair enough, so what ive done is defined the hook by removing  
> the .tmpl extension on the template file that ships w/ the repo.
> and the script is executable as well,
> -rwxr-xr-x 1 apache apache 58 Feb 28 00:39 /moxune/repository/hooks/ 
> pre-revprop-change
>
> great, so im still getting the error message.
> to rule out the latter part of the message, namely does the script  
> exist, i have added some trivial logging to the script,
> which is writing out to the target file, indicating the script not  
> only exists, but svn is successfully invoking it.
> and for the former part of the message, is the script failing, well  
> all its doing is echoing a string to a file and calling exit 0 so i  
> dont think its failing.
> here is my hook script
>
> #!/bin/sh
> echo 'called me' >> /home/nathan/imCrazy
> exit 0
>
> and as i said, 'called me' is getting written to /home/nathan/ 
> imCrazy; twice actually (dont know why)
> i dont know how i could write any more trivial of a hook script.   
> afaict, this should be returning successfully to the caller and the  
> property should be getting set in the repository.
> here is the command im using to invoke the property change
>
> svn propset eol:style --revprop -r HEAD native https:// 
> dev.moxune.com/svn/repos/sentinelWorking/branches/sentinel_v1.2/code


First of all, it's called "svn:eol-style" (not "eol:style").

Second, it's a file property, not a revision property. You do not  
need a pre-revprop-change hook, because you're not going to be  
changing a revision property.

Go to a working copy and set the svn:eol-style property of the file  
whose line endings you want to specify. For example:

cd working-copy
svn propset svn:eol-style native foo.txt
svn ci -m "foo.txt: setting svn:eol-style to native"



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

Re: pre-revprop-change

Posted by Matthew Hannigan <ml...@zip.com.au>.
On Thu, Feb 28, 2008 at 12:46:13AM -0500, Nathan Nobbe wrote:
> here is my hook script
> 
> #!/bin/sh
> echo 'called me' >> /home/nathan/imCrazy
> exit 0

You're trying to write to a user's file ...
> 
> svn propset eol:style --revprop -r HEAD native
> https://dev.moxune.com/svn/repos/sentinelWorking/branches/sentinel_v1.2/code

As the user running apache.

I don't think this can work.

echo to some file in /tmp instead




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