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

"Emulate clean checkout by..." does not work with 1.7 subversion repositories

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • subversion-plugin
    • Windows XP x64, Core i7

      The update strategy "Emulate clean checkout by..." does not delete files which are not part of the repository although the log reports that a cleanup is performed.

          [JENKINS-13844] "Emulate clean checkout by..." does not work with 1.7 subversion repositories

          Marcel Beister created issue -

          sogabe added a comment -

          Subversion Plugin DOES NOT support 1.7.

          sogabe added a comment - Subversion Plugin DOES NOT support 1.7.

          To clarify this: The error happens when I chose "1.7" as format for the working copy, the server runs subversion "1.6".

          Marcel Beister added a comment - To clarify this: The error happens when I chose "1.7" as format for the working copy, the server runs subversion "1.6".
          Marcel Beister made changes -
          Link New: This issue is related to JENKINS-13835 [ JENKINS-13835 ]

          See Issue #2.

          Marcel Beister added a comment - See Issue #2.
          Marcel Beister made changes -
          Link New: This issue is duplicated by JENKINS-13859 [ JENKINS-13859 ]

          Same for me using SVN server 1.5, Jenkins 1.472 + SVN 1.42 plugin, SVN WC 1.7
          Issue occurs on a WinXP 32bit slave

          Denis Eperonnier added a comment - Same for me using SVN server 1.5, Jenkins 1.472 + SVN 1.42 plugin, SVN WC 1.7 Issue occurs on a WinXP 32bit slave

          Martin Adam added a comment -

          same here, environmen same as in comment above me, only I have jenkins 1.475 and it's a master building node

          Martin Adam added a comment - same here, environmen same as in comment above me, only I have jenkins 1.475 and it's a master building node

          Chris Lee added a comment -

          This is caused by changes in SVN 1.7 relating to ignored files - they are no longer reported by default in 'svn status' (the SVNKit API used by Jenkins mirrors this behaviour).

          In the workspace for a Jenkins project (after the job has run), no changes are shown:

          [root@devemr01 UTIL_TRUNK]# svn status
          

          However, the below command shows files/directories that are marked as ignored:

          [root@devemr01 UTIL_TRUNK]# svn status --no-ignore
          I       .gradle
          I       build
          

          ...and creating a new file that isn't ignored shows up in 'svn status':

          [root@devemr01 UTIL_TRUNK]# touch foo
          [root@devemr01 UTIL_TRUNK]# svn status
          ?       foo
          

          UpdateWithCleanUpdater.java needs to explicitly request that SVNKit include 'ignored' files such that they can be deleted.

          Chris Lee added a comment - This is caused by changes in SVN 1.7 relating to ignored files - they are no longer reported by default in 'svn status' (the SVNKit API used by Jenkins mirrors this behaviour). In the workspace for a Jenkins project (after the job has run), no changes are shown: [root@devemr01 UTIL_TRUNK]# svn status However, the below command shows files/directories that are marked as ignored: [root@devemr01 UTIL_TRUNK]# svn status --no-ignore I .gradle I build ...and creating a new file that isn't ignored shows up in 'svn status': [root@devemr01 UTIL_TRUNK]# touch foo [root@devemr01 UTIL_TRUNK]# svn status ? foo UpdateWithCleanUpdater.java needs to explicitly request that SVNKit include 'ignored' files such that they can be deleted.

          Chris Lee added a comment -

          Code from UpdateWithCleanUpdater.java:

            clientManager.getStatusClient().doStatus(local, null, SVNDepth.INFINITY, false, false, true, false, new ISVNStatusHandler() {
                          public void handleStatus(SVNStatus status) throws SVNException {
                              SVNStatusType s = status.getContentsStatus();
                              if (s == SVNStatusType.STATUS_UNVERSIONED || s == SVNStatusType.STATUS_IGNORED || s == SVNStatusType.STATUS_MODIFIED) {
                                  listener.getLogger().println("Deleting "+status.getFile());
                                  try {
                                      File f = status.getFile();
                                      if (f.isDirectory())
                                          hudson.Util.deleteRecursive(f);
                                      else
                                          f.delete();
                                  } catch (IOException e) {
                                      throw new SVNException(SVNErrorMessage.create(SVNErrorCode.UNKNOWN, e));
                                  }
                              }
                          }
                      }, null);
          

          ...the fifth parameter is 'includeIgnored' which is strangely set to false (and always has been), although the subsequent code expects ignored elements. Guessing that the inclusion of 'ignored' files was a bug with previous SVN (and SVNKit) versions that Jenkins inadvertently relied on.

          SVNKit API: http://svnkit.com/javadoc/org/tmatesoft/svn/core/wc/SVNStatusClient.html#doStatus(java.io.File, org.tmatesoft.svn.core.wc.SVNRevision, org.tmatesoft.svn.core.SVNDepth, boolean, boolean, boolean, boolean, org.tmatesoft.svn.core.wc.ISVNStatusHandler, java.util.Collection)

          Chris Lee added a comment - Code from UpdateWithCleanUpdater.java: clientManager.getStatusClient().doStatus(local, null , SVNDepth.INFINITY, false , false , true , false , new ISVNStatusHandler() { public void handleStatus(SVNStatus status) throws SVNException { SVNStatusType s = status.getContentsStatus(); if (s == SVNStatusType.STATUS_UNVERSIONED || s == SVNStatusType.STATUS_IGNORED || s == SVNStatusType.STATUS_MODIFIED) { listener.getLogger().println( "Deleting " +status.getFile()); try { File f = status.getFile(); if (f.isDirectory()) hudson.Util.deleteRecursive(f); else f.delete(); } catch (IOException e) { throw new SVNException(SVNErrorMessage.create(SVNErrorCode.UNKNOWN, e)); } } } }, null ); ...the fifth parameter is 'includeIgnored' which is strangely set to false (and always has been), although the subsequent code expects ignored elements. Guessing that the inclusion of 'ignored' files was a bug with previous SVN (and SVNKit) versions that Jenkins inadvertently relied on. SVNKit API: http://svnkit.com/javadoc/org/tmatesoft/svn/core/wc/SVNStatusClient.html#doStatus(java.io.File , org.tmatesoft.svn.core.wc.SVNRevision, org.tmatesoft.svn.core.SVNDepth, boolean, boolean, boolean, boolean, org.tmatesoft.svn.core.wc.ISVNStatusHandler, java.util.Collection)

            Unassigned Unassigned
            simabeis Marcel Beister
            Votes:
            8 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: