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

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

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: kohsuke
          Path:
          src/main/java/hudson/scm/SubversionRepositoryStatus.java
          http://jenkins-ci.org/commit/subversion-plugin/d00f620ba96bad5eb21a482d7216e000eaaae1f6
          Log:
          [FIXED JENKINS-11263] SVN post-commit hook doesn't work at root of repository

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: kohsuke Path: src/main/java/hudson/scm/SubversionRepositoryStatus.java http://jenkins-ci.org/commit/subversion-plugin/d00f620ba96bad5eb21a482d7216e000eaaae1f6 Log: [FIXED JENKINS-11263] SVN post-commit hook doesn't work at root of repository
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: kohsuke
          Path:
          src/main/java/hudson/scm/SubversionRepositoryStatus.java
          http://jenkins-ci.org/commit/subversion-plugin/d00f620ba96bad5eb21a482d7216e000eaaae1f6
          Log:
          [FIXED JENKINS-11263] SVN post-commit hook doesn't work at root of repository

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: kohsuke Path: src/main/java/hudson/scm/SubversionRepositoryStatus.java http://jenkins-ci.org/commit/subversion-plugin/d00f620ba96bad5eb21a482d7216e000eaaae1f6 Log: [FIXED JENKINS-11263] SVN post-commit hook doesn't work at root of repository
          Hide
          dogfood dogfood added a comment -
          Show
          dogfood dogfood added a comment - Integrated in plugins_subversion #115

            People

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

              Dates

              • Created:
                Updated:
                Resolved: