After PR merged from feature branch to svn mirror branch it uses the svn mirror login user as committor in svn

Hi Team,

after PR is merged from the feature branch to the svn mirror branch in Bitbucket,it uses the svn mirror login user as a committer in the svn, it should show the same user in svn side who is merged that PR , but here it is showing svn user which we used for configure the mirror , can you please advise asap

Thanks,
Manju NS

Hi Manju,

most probably this happens because the SVN server does not allow to set svn:author property and it remains set to the “svn mirror” user: the matter is that SVN Mirror add-on sets a revision author in a separate connection during a revision translation – it first connects to SVN, creates a new revision and sets the revision’s author equal to the SVN username configured for mirror. Then it connects to the SVN server once again and changes the newly created revision svn:author property setting it to the correct author name. At some point SVN developers changed the code so that if SVN version 1.7.20, 1.8.12 or 1.9.0 or later is used and it’s being accessed over http(s) or svn protocols, then SVN server does not allow setting the svn:author property separately in the way SVN Mirror does. In order to allow SVN Mirror to set the authors, pre-revprop-change hook has to be enabled in the SVN repository. That requirement is introduced by SVN and that’s why we need to make some changes on SVN side. The hook can do nothing at all, just start and exit successfully, it should be just an executable script or binary that returns 0 on exit. So you can just create as simple script as

  • Linux and OS X:
  #!/bin/sh
  exit 0;
  • Windows:
  @echo off
  exit 0

place it into SVN repository hooks directory:

    SVN_REPOSITORY/
        hooks/
            pre-revprop-change     # for Linux and OS X
            pre-revprop-change.bat # for Windows

make the file executable in Linux/MacOS

chmod +x pre_revprop_change

and that’s all.

Hi ,

no luck,

i have created “pre_revprop_change” hook file in svn server side and tested it, still not user is reflecting at svn side , but git side it will say commit user name but svn side it is saying mirror user name , Please advise ASAP

we can have call if required so i can share the screen and show

Thanks,
Manju NS

Hi Ildar,

any updates on above?

Thanks,
Manju NS

Hello,
could you try the same with ‘pre-revprop-change’ hook? ‘pre_revprop_change’ is not a correct hook name and a hook with such name is just ignored by SVN.

You can quickly test whether the hook works correctly using

svn propset --revprop -rREV propname propval http://your/svn/url

where REV is any revision number, e.g. 1. If the hook works correctly, the command succeeds and

svn propget --revprop -REV propname http://your/svn/url

should print

propval

If the hook works incorrectly, “svn propset” command above will fail.

When the hook works correctly, SVN Mirror app is allowed to set svn:author property to the correct value and SVN revisions will have the correct author.

Hi Dimitry,

thanks for the help, which is fixed now

the issue was, i was used file name from Ildar’s chmod command which uses an underscore instead of “-”

Thanks,
Manju NS