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

In "Check-out Strategy" there are separate "revert" and "clean" options, but there is no "clean and revert" option.

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • subversion-plugin
    • None
    • Tested on Windows 32 bits running as a service, but it should occur on any environment.

      My project needs to have all new files deleted and existing files to be reverted before each update. I can only choose one or the other, I need both.

          [JENKINS-9714] In "Check-out Strategy" there are separate "revert" and "clean" options, but there is no "clean and revert" option.

          Adam Vollmer added a comment -

          I just came here to report this very issue.

          Adam Vollmer added a comment - I just came here to report this very issue.

          Kohsuke Kawaguchi added a comment - - edited

          IIUC, "clean" essentially means "rm -rf" the workspace and do "svn checkout". Given this, I don't see how it makes sense to do any "svn revert" there.

          I was confusing this with the clean checkout.

          Kohsuke Kawaguchi added a comment - - edited IIUC, "clean" essentially means "rm -rf" the workspace and do "svn checkout". Given this, I don't see how it makes sense to do any "svn revert" there. I was confusing this with the clean checkout.

          Adam Vollmer added a comment -

          I ran into a build issue recently because one of our build scripts changed, so a now-vestigal directory was causing problems because it was no longer being cleaned up. the execution was

          Jenkins runs old-build-script clean which cleans foo/lib
          Jenkins runs old-build-script build which creates foo/lib and populates it
          build script change is checked in
          Jenkins runs new-build-script clean which no longer cleans foo/lib
          Jenkins runs new-build-script build which no longer creates foo/lib, but the old content is there.

          The only real workaround on my end is to always be vigilant for all possible places that code could possibly affect my build and preemptively clean them in all cases, regardless of whether I'd place anything there. That puts a huge burden on me.

          Adam Vollmer added a comment - I ran into a build issue recently because one of our build scripts changed, so a now-vestigal directory was causing problems because it was no longer being cleaned up. the execution was Jenkins runs old-build-script clean which cleans foo/lib Jenkins runs old-build-script build which creates foo/lib and populates it build script change is checked in Jenkins runs new-build-script clean which no longer cleans foo/lib Jenkins runs new-build-script build which no longer creates foo/lib, but the old content is there. The only real workaround on my end is to always be vigilant for all possible places that code could possibly affect my build and preemptively clean them in all cases, regardless of whether I'd place anything there. That puts a huge burden on me.

          Shannon Kerr added a comment -

          I don't think this is an issue any longer. I'm not sure when the functionality was introduced, but the clean option now says (plugin version 1.50 and Jenkins version 1.518):

          "Jenkins will first remove all the unversioned/modified files/directories, as well as files/directories ignored by "svn:ignore", then execute "svn update". This emulates the fresh check out behaviour without the cost of full checkout."

          So, the clean option now behaves as a "clean+revert" followed by an update. The only functionality missing now is a clean without a revert followed by an update. That should go in a separate ticket if truly desired.

          Shannon Kerr added a comment - I don't think this is an issue any longer. I'm not sure when the functionality was introduced, but the clean option now says (plugin version 1.50 and Jenkins version 1.518): "Jenkins will first remove all the unversioned/modified files/directories, as well as files/directories ignored by "svn:ignore", then execute "svn update". This emulates the fresh check out behaviour without the cost of full checkout." So, the clean option now behaves as a "clean+revert" followed by an update. The only functionality missing now is a clean without a revert followed by an update. That should go in a separate ticket if truly desired.

          jenkins Version: 2.16
          SVN plugin Version: 2.6

          Actually, this is still an issue:
          "Emulate clean checkout by first deleting unversioned/ignored files, then 'svn update'" does just what is says. It does NOT remove (as the description wrongly suggests!) nor revert modified versioned files (as I would have expected).

          whereas

          "Use 'svn update' as much as possible, with 'svn revert' before update" does NOT remove all unversioned files, apparently just the ones svn:ignore'd.

          So a combination of both options is still missing. Currently I have to perform a costly clean checkout to prepare for a clean build.

          Erich Mauerböck added a comment - jenkins Version: 2.16 SVN plugin Version: 2.6 Actually, this is still an issue: "Emulate clean checkout by first deleting unversioned/ignored files, then 'svn update'" does just what is says. It does NOT remove (as the description wrongly suggests!) nor revert modified versioned files (as I would have expected). whereas "Use 'svn update' as much as possible, with 'svn revert' before update" does NOT remove all unversioned files, apparently just the ones svn:ignore'd. So a combination of both options is still missing. Currently I have to perform a costly clean checkout to prepare for a clean build.

          Jack Pei added a comment - - edited

          The code already does what has been asked here since its introduction in 2010. Check the source code at https://github.com/jenkinsci/subversion-plugin/blob/master/src/main/java/hudson/scm/subversion/UpdateWithCleanUpdater.java . The only thing I'd suggest change is its display name in https://github.com/jenkinsci/subversion-plugin/blob/master/src/main/resources/hudson/scm/subversion/Messages.properties (line 84) to "Emulate clean checkout by first deleting unversioned/modified/ignored files, then ''svn update''".

          Jack Pei added a comment - - edited The code already does what has been asked here since its introduction in 2010. Check the source code at https://github.com/jenkinsci/subversion-plugin/blob/master/src/main/java/hudson/scm/subversion/UpdateWithCleanUpdater.java  . The only thing I'd suggest change is its display name in https://github.com/jenkinsci/subversion-plugin/blob/master/src/main/resources/hudson/scm/subversion/Messages.properties  (line 84) to "Emulate clean checkout by first deleting unversioned/modified/ignored files, then ''svn update''".

          Erich Mauerböck added a comment - - edited

          I worked around this by doing a 'svn cleanup --remove-unversioned' before or after reverting.

          Erich Mauerböck added a comment - - edited I worked around this by doing a 'svn cleanup --remove-unversioned' before or after reverting.

            Unassigned Unassigned
            jaderd Jader Dias
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: