Can't modify changeset in PreReceiveRepositoryHook

13 views
Skip to first unread message

Valerie Wagner

unread,
Apr 4, 2014, 6:33:25 PM4/4/14
to scmma...@googlegroups.com

I am attempting to modify the author field of our Subversion commits. (We want to change it to user's display name + username in the real svn database, not just in SCM Manager's web UI.)

I am trying to set the author name to "XYZ" in all cases for a test. I am doing commits as the "scmadmin" user. I have been unable to have any effect on the actual value of the changeset author field. (Both using command-line svn log and the SCMM web UI, the author is still set to "scmadmin".)

@Extension
public class SVNUsernamePreCommitHook extends PreReceiveRepositoryHook {

   
@Override
   
public void onEvent(RepositoryHookEvent event) {

       
Collection<Changeset> changesets = event.getChangesets();
       
for (Changeset changeset : changesets) {
           
Person p = changeset.getAuthor();
            p
.setName("XYZ");
       
}
   
}
   

Does this mean that the RepositoryHookEvent object is only informative? that it has no effect on the actual repository data?

thanks in advance!

Valerie


Sebastian Sdorra

unread,
Apr 6, 2014, 9:49:58 AM4/6/14
to scmma...@googlegroups.com
Hi,
Yes, this true. RepositoryHooks of SCM-Manager 1.x are only informative. We will try to change this in version 2.x.

Sebastian


--
You received this message because you are subscribed to the Google Groups "scmmanager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scmmanager+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Valerie Wagner

unread,
Apr 7, 2014, 7:35:44 PM4/7/14
to scmma...@googlegroups.com
Thanks, Sebasian. I was able to get what I needed by going directly to svnkit using FSHooks.registerHook().
Reply all
Reply to author
Forward
0 new messages