Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-11263

SVN post-commit hook doesn't work at root of repository

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • subversion-plugin
    • None

      If your repository path is "/" or "" (e.g. you've checked out the entire repository) then the SVN post-commit hook won't work if your commit only includes files at the root of the repository.

      To explain further, my repository is "svn://jenkins.local" - a server that just runs Jenkins and is looked up via mDNS. The repository is simple enough that I check out the whole thing.

      Now, in SubversionRepositoryStatus.java, lines 113 and 114, both 'm' and 'n' (whatever they are!) evaluate to "". So 'remaining' evaluates to "" and 'remainingSlash' evaluates to "/".

      If make a commit which only touches files at the root of the repository, the SVN post-commit hook content includes, for example:

      A file1
      A file2
      [...etc...]

      Down on line 132 (inside the loop over all affected paths), neither side of the '||' condition evaluates to true, because SVN doesn't report a leading '/' on any of the paths in the post-commit message contents.

      We can work around it for now by altering our post-commit hook to send "A..." as the content, so that the affected path is an empty string, but that's not ideal.

            Unassigned Unassigned
            danny Danny Yates
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: