Opened 17 years ago

Closed 17 years ago

#12593 closed enhancement (fixed)

svn post-revprop-change hook

Reported by: jmpalacios (Juan Manuel Palacios) Owned by: wsiegrist@…
Priority: Normal Milestone:
Component: server/hosting Version:
Keywords: post-revprop, commit hook Cc: macports-mgr@…, ryandesign (Ryan Carsten Schmidt)
Port:

Description

From time to time we see ourselves in the need of editing svn revprops like svn:log to amend mistakes. It would be great to have a post-revprop-change hook to perform a number of actions once these are committed to the repo, like mailing the macports-changes mailing list with the edit and updating the trac db to reflect the new property, just like the current post-commit hook does.

I'll see about writing the hook myself and attaching it here to this ticket, so that the only thing necessary to make it work is installing it on svn.macports.org

-jmpp

Change History (11)

comment:1 Changed 17 years ago by jmpalacios (Juan Manuel Palacios)

Keywords: post-revprop commit hook added

comment:2 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added

We currently use SVN::Notify to send out commit mails, but I'm not sure SVN::Notify provides a way to send revprop-change mails. Many other Subversion mailing packages do.

comment:3 Changed 17 years ago by jmpalacios (Juan Manuel Palacios)

Subversion installs some template hooks by default at repo-creation time, one of them being post-revprop-change.tmpl, which I'm thinking we could adapt to meet the functionality we seek. I haven't been able to look into it in any detail yet, though, so if you have any other suggestions please do list them here.

-jmpp

comment:4 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

The post-revprop-change.tmpl only shows you how you can run a script:

propchange-email.pl "$REPOS" "$REV" "$USER" "$PROPNAME" watchers@example.org

The postchange-email.pl script referenced by this example used to be part of Subversion, but for 1.4.0 the functionality was absorbed by commit-email.pl. I will inform the Subversion folks that they need to fix their post-revprop-change.tmpl to mention commit-email.pl instead of postchange-email.pl.

My point was that we probably want the post-revprop-change email to be formatted similarly to the post-commit email, which means they should probably be sent by the same tool. But as far as I can tell, SVN::Notify, the tool we currently use to send out post-commit mails, does not offer a mode by which it could send out post-revprop-change mails. We may wish to contact the author of SVN::Notify and ask if there is a hidden option to do this or if this feature is being developed and will be released soon, or we may wish to switch to other Subversion email notification scripts which are already known to support both modes, such as commit-email.pl.

comment:5 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

The Subversion team has fixed the post-revprop-change.tmpl for Subversion 1.5. This changeset shows how we could use commit-email.pl to send a post-revprop-change email. Alternately, I understand that mailer.py is another popular mailer script.

comment:6 Changed 17 years ago by wsiegrist@…

Resolution: fixed
Status: newclosed

Fixed with commit-email.pl. Same email settings as the post-commit and svnnotify.

comment:7 Changed 17 years ago by jmpalacios (Juan Manuel Palacios)

Resolution: fixed
Status: closedreopened
Version: 1.5.0

I'm reopening this ticket to track its current status, as it still needs some implementation improvements:

  • The "Author" field of the mail body should hold the original author of the revision that's having its revprops edited, not the author editing the revprop itself, as it actually stands now;
  • The "New Property Value" field holds the new revprop that was entered (as expected), so it would be great if an "Old Property Value" field right above the former could hold the original revprop that was edited, in order to properly compare old and new values.

Thanks!

-jmpp

comment:8 Changed 17 years ago by wsiegrist@…

Owner: changed from kvv@… to wsiegrist@…
Status: reopenednew

comment:9 Changed 17 years ago by wsiegrist@…

Status: newassigned

comment:10 Changed 17 years ago by wsiegrist@…

The revprop change emails now contain a unified diff instead of the "new value".

I disagree on your Author point. I realize that the email gets addressed from the person making the changes, but wont it be confusing to see the email stating the original author along side changes they didnt actually make?

comment:11 Changed 17 years ago by wsiegrist@…

Resolution: fixed
Status: assignedclosed

I added a (original author: foo@macports) to the Author line of the email. I believe this satisfies the ticket, so I'm going to close it.

Note: See TracTickets for help on using tickets.