title: How to do a sparse checkout and update from SVN on Jenkins?
body: <p>We have a large SVN repository and I would like to do a sparse checkout on Jenkins. I do understand the concept of sparse checkouts and having it locally I can get things to work as I would like to have it. Doing things on Jenkins however and running it repeatedly I can't get to work.</p>
  
  <p>I have a repo structure as follows</p>
  
  <pre><code>trunk\file.txt
  trunk\FolderA
  trunk\FolderB
  trunk\FolderC
  trunk\FolderD
  </code></pre>
  
  <p>I would like to checkout and update </p>
  
  <pre><code>trunk\file.txt
  trunk\FolderA
  trunk\FolderB
  </code></pre>
  
  <p>but <em>NOT</em></p>
  
  <pre><code>trunk\FolderC
  trunk\FolderD
  </code></pre>
  
  <p>My pipeline code is as follows</p>
  
  <pre><code>checkout([$class: 'SubversionSCM', 
      additionalCredentials: [[credentialsId: strCredentialsId, realm: strRealm]],
      excludedCommitMessages: '', 
      excludedRegions: '', 
      excludedRevprop: '', 
      excludedUsers: '', filterChangelog: false, 
      ignoreDirPropChanges: false, 
      includedRegions: '', 
      locations: [
          [
              remote: "${strRepoPath}/trunk",
              local: "${softwarePath}", 
              depthOption: 'unknown', 
              credentialsId: strCredentialsId,
              cancelProcessOnExternalsFail: true, 
              ignoreExternalsOption: false
          ],
          [
              remote: "${strRepoPath}/trunk/FolderA",
              local: "${softwarePath}/FolderA", 
              depthOption: 'infinity', 
              credentialsId: strCredentialsId, 
              cancelProcessOnExternalsFail: true, 
              ignoreExternalsOption: false
          ],
          [
              remote: "${strRepoPath}/trunk/FolderB",
              local: "${softwarePath}/FolderB", 
              depthOption: 'infinity', 
              credentialsId: strCredentialsId, 
              cancelProcessOnExternalsFail: true, 
              ignoreExternalsOption: false
          ]
      ],
      quietOperation: false, 
      workspaceUpdater: [$class: 'UpdateWithCleanUpdater']])
  
  </code></pre>
  
  <p>Whenever I run this code the first time, everything looks as expected. However, when Jenkins runs it the following times, the <em>UpdateWithCleanUpdater</em> causes that FolderA and FolderB get first deleted and then checked out again. The result is still correct, however, it takes much longer that I would like it to take and longer than necessary.</p>
  
  <p>I would like to keep the <em>UpdateWithCleanUpdater</em> because I want Jenkins to clean up files generated in the previous run.</p>
  
  <p>Is there any solution to this using the Jenkins SVN plugin? How would I do this "manually", i.e. do a checkout the first time, clean up and only update the following times, and still do automatic Jenkins runs based on change detection on the SVN repo?</p>
  
  <p>Thanks in advance!</p>