When updating the 'stable' builds of our projects, I update the repository URL
      from svn://aaa/project/branches/182 to svn://aaa/project/branches/183 ( for
      instance ).

      This results in a clean checkout ( Checking out a fresh workspace because the
      workspace is not svn://aaa/project/branches/183 ), which takes somewhere around
      30 minutes, when a svn switch would've taken a few seconds.

      What I suggest is a (perhaps per job configurable) setting which would use svn
      switch if all but the last

      {x}

      path elements are the same.

      For instance, a setting of 1 would allow switch to be used for

      svn://aaa/project/branches/183 -> svn://aaa/project/branches/184

      but not for

      svn://aaa/project/branches/183 -> svn://aaa/project/trunk

      A setting of 2 would allow switch to be used for both.

      A setting of 0 would disallow the usage of svn switch.

        1. subversion.diff
          12 kB
        2. subversion2.diff
          10 kB
        3. subversion3.diff
          11 kB

          [JENKINS-2556] Use svn switch where applicable

          Robert Munteanu created issue -

          mschemmel added a comment -

          This would be extremely useful, even if it were as simple as
          [x] Use switch
          [ ] Use update

          in the configuration of each job.

          Parameterized builds for testing individual feature workspaces, which generally change a minimal number of the artifacts in the repository, take far longer than necessary due to the need to retrieve a largish repository before beginning each build.

          The "development testing" Hudson jobs we use do not cause any artifacts to be committed back to the repository, so there is no danger of merge conflicts through local modifications... the ability to select 'switch' vs 'update' on a per-job basis would greatly magnify the utility enabled by the tool.

          mschemmel added a comment - This would be extremely useful, even if it were as simple as [x] Use switch [ ] Use update in the configuration of each job. Parameterized builds for testing individual feature workspaces, which generally change a minimal number of the artifacts in the repository, take far longer than necessary due to the need to retrieve a largish repository before beginning each build. The "development testing" Hudson jobs we use do not cause any artifacts to be committed back to the repository, so there is no danger of merge conflicts through local modifications... the ability to select 'switch' vs 'update' on a per-job basis would greatly magnify the utility enabled by the tool.
          mdonohue made changes -
          Link New: This issue is duplicated by JENKINS-5081 [ JENKINS-5081 ]

          ymajoros added a comment -

          I also think this would be very good. We use to tag our builds as TEST or PROD, so we know this tagged version is what is going to TEST/PROD.

          In order to do that, I always have to:

          • disable hudson job for the TEST or PROD task
          • remove the old TEST or PROD tag (svn remove)
          • create a new tag (usually, svn copy from dev branch)
          • go to job build directory and manually run svn switch
          • enable hudson job again

          Enabling hudson to switch would really be a good thing.

          ymajoros added a comment - I also think this would be very good. We use to tag our builds as TEST or PROD, so we know this tagged version is what is going to TEST/PROD. In order to do that, I always have to: disable hudson job for the TEST or PROD task remove the old TEST or PROD tag (svn remove) create a new tag (usually, svn copy from dev branch) go to job build directory and manually run svn switch enable hudson job again Enabling hudson to switch would really be a good thing.

          samodelkin added a comment -

          Attached patch implements "Switch" option for "Update".

          samodelkin added a comment - Attached patch implements "Switch" option for "Update".
          samodelkin made changes -
          Attachment New: subversion.diff [ 19502 ]

          Thank you for the patch, and my apologies for the delay.

          In Hudson, we try hard to avoid providing too many switches, and I'm afraid this change doesn't pass that test.

          My proposal is to look at the SVNInfo.getRepositoryRootURL() to determine if the current checked-out copy and the checkout URL shares the same repository root, and if so, use "svn switch" instead of full-blown "svn checkout" in IsUpdatableTask.

          In this way, no user configuration is necessary.

          Kohsuke Kawaguchi added a comment - Thank you for the patch, and my apologies for the delay. In Hudson, we try hard to avoid providing too many switches, and I'm afraid this change doesn't pass that test. My proposal is to look at the SVNInfo.getRepositoryRootURL() to determine if the current checked-out copy and the checkout URL shares the same repository root, and if so, use "svn switch" instead of full-blown "svn checkout" in IsUpdatableTask. In this way, no user configuration is necessary.

          samodelkin added a comment -

          Attached patch implements "svn switch" when doing update if repository root is not changed.

          samodelkin added a comment - Attached patch implements "svn switch" when doing update if repository root is not changed.
          samodelkin made changes -
          Attachment New: subversion2.diff [ 19557 ]

          samodelkin added a comment -

          subversion2.diff is incorrect. The following error happens when matrix project is built:

          Started by upstream project "platform-release-build" build number 28
          Building remotely on qa-poa-as4-x86
          hudson.util.IOException2: remote file operation failed: /home/buildbot/hudson/workspace/platform-release-build/label/qa-poa-as4-x86 at hudson.remoting.Channel@380dc55c:qa-poa-as4-x86
          at hudson.FilePath.act(FilePath.java:749)
          at hudson.FilePath.act(FilePath.java:735)
          at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:597)
          at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:544)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1044)
          at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
          at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
          at hudson.model.Run.run(Run.java:1257)
          at hudson.matrix.MatrixRun.run(MatrixRun.java:130)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:127)
          Caused by: java.io.IOException: Unable to serialize hudson.FilePath$FileCallableWrapper@77fc501e
          at hudson.remoting.UserRequest.serialize(UserRequest.java:162)
          at hudson.remoting.UserRequest.<init>(UserRequest.java:62)
          at hudson.remoting.Channel.call(Channel.java:554)
          at hudson.FilePath.act(FilePath.java:742)
          ... 10 more
          Caused by: java.io.NotSerializableException: hudson.matrix.MatrixConfiguration
          at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
          at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
          at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
          at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
          at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
          at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
          at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
          at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
          at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
          at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
          at hudson.remoting.UserRequest._serialize(UserRequest.java:151)
          at hudson.remoting.UserRequest.serialize(UserRequest.java:160)
          ... 13 more

          Fixed version is attached

          samodelkin added a comment - subversion2.diff is incorrect. The following error happens when matrix project is built: Started by upstream project "platform-release-build" build number 28 Building remotely on qa-poa-as4-x86 hudson.util.IOException2: remote file operation failed: /home/buildbot/hudson/workspace/platform-release-build/label/qa-poa-as4-x86 at hudson.remoting.Channel@380dc55c:qa-poa-as4-x86 at hudson.FilePath.act(FilePath.java:749) at hudson.FilePath.act(FilePath.java:735) at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:597) at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:544) at hudson.model.AbstractProject.checkout(AbstractProject.java:1044) at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411) at hudson.model.Run.run(Run.java:1257) at hudson.matrix.MatrixRun.run(MatrixRun.java:130) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:127) Caused by: java.io.IOException: Unable to serialize hudson.FilePath$FileCallableWrapper@77fc501e at hudson.remoting.UserRequest.serialize(UserRequest.java:162) at hudson.remoting.UserRequest.<init>(UserRequest.java:62) at hudson.remoting.Channel.call(Channel.java:554) at hudson.FilePath.act(FilePath.java:742) ... 10 more Caused by: java.io.NotSerializableException: hudson.matrix.MatrixConfiguration at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326) at hudson.remoting.UserRequest._serialize(UserRequest.java:151) at hudson.remoting.UserRequest.serialize(UserRequest.java:160) ... 13 more Fixed version is attached
          samodelkin made changes -
          Attachment New: subversion3.diff [ 19560 ]

            kutzi kutzi
            rombert Robert Munteanu
            Votes:
            21 Vote for this issue
            Watchers:
            22 Start watching this issue

              Created:
              Updated:
              Resolved: