[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

svn and shell scripts: managing properties

From: Jan Warnking <jan.warnking_at_ujf-grenoble.fr>
Date: 2006-03-10 11:25:29 CET

Hello all,

I'm just discovering subversion and am in the process of setting up a
couple of Linux shell scripts for some common operations we perform on
our code. That involves setting/modifying properties on files
automatically. It was not long before I ran into a couple of
difficulties doing that:

- a minor annoyance of the proplist command is that it cannot be asked
to omit the first line, which reads "Properties on 'mypath':" and which
does not actually contain property names. I expected either the --quiet
or the --non-interactive switch to do that for me. The former does not
exist for propedit, the latter doesn't change the output. This makes
scripts unnecessarily cumbersome. I'm not really good at shellscripts
yet, so any code snipped stripping that line from the output would be

- a bigger annoyance is the algorithm used for checking whether a
property has been modified with a propedit command. If I do:
svn propedit myproperty --editor-cmd "sed -i -e 's/foo/bar/g'" mypath
then svn will respond: "No changes to property 'myproperty' on
'mypath'". This occurs because SVN checks the timestamp (modification
time) and file size of the temporary file containing the property value,
in order to determine whether a change occurred. Sed is fast enough so
that the modification time appears unchanged, and the replacement done
does not change file length. Of course I can change this command to:
svn propedit myproperty --editor-cmd "sleep 2; sed -i -e 's/foo/bar/g'"
That works, but is slow. The whole point of scripting is that I have
potentially many files to process.

I guess both issues are in part feature requests, (being able to
suppress anything not containing property names/values from the output
of proplist and having an option for MD5SUM comparison of the temporary
file before and after a propedit command to detect changes to the
property value). But for now I'd be glad for any suggestions on how to
work around these quirks.

I'm using version 1.2.1, but observed the same behaviour on 1.3.0.


To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Mar 10 11:27:59 2006

This is an archived mail posted to the Subversion Users mailing list.