On Wed, Mar 17, 2004 at 04:06:41PM +0000, Julian Foad wrote:
> Whenever I see a prop-change email (usually for svn:log) I always wonder
> what has been changed, and so I would like it to show the previous value or
> preferably a diff.
>
> I have implemented this by having the pre- and post-revprop-change hook
> scripts save a copy of the property value, and then propchange-email.pl do
> a diff of the two saved copies. Theoretically this could be confused by
> simultaneous changes, but in practice for most of us this is very unlikely.
>
> The way I have written the hook scripts only works for the "svn:log"
> property, and only on Unix-like systems.
>
> A patch is attached but it is only for further development, not for
> committing. Note that it includes patches to "pre-" and
> "post-revprop-change.tmpl", rather than to the source code that writes
> these files.
>
> It would be neater if, instead, propchange-email.pl were called in a
> "pre-change" mode to save the previous value, and then called in the normal
> (post-change) mode to compare its saved value with the new value and do the
> rest of its work. My Perl skills are not up to the task, so I am sort of
> hoping that someone else might like to do that.
Dumb question, but why don't you just do the actual diff in the
pre-revprop? You have access to the new proval as STDIN? Then just
write out the diff to a temp file that the post hook reads and sends
along.
Also I'd add the author name to the filename. It's possible that two
people would try to edit the same property at the same time. GMTA. But
unlikely that the same person is going to be editing the same property
at the same time. It's still possible but pretty unlikely.
--
Ben Reser <ben@reser.org>
http://ben.reser.org
"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Mar 18 01:40:18 2004