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

Poor implementation of "clean build" feature for Hg-controlled workspaces

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • mercurial-plugin
    • None
    • Platform: All, OS: All

      The current impl in MercurialSCM just does

      for( FilePath child : workspace.list((FileFilter)null) )

      { if(child.getName().equals(".hg")) continue; child.deleteRecursive(); }

      which deletes version-controlled files along with everything else, forcing a
      clean checkout the next time (much slower than a pull for a big repository), and
      fragmenting the disk.

      Better would be to run

      hg up -C .
      hg --config extensions.purge= clean --all

      which (1) reverts any accidental modifications made to source files by the
      previous build, (2) deletes all and only those files which are not listed in the
      Hg manifest for the current revision.

      I could implement the change if you agree.

          [JENKINS-2666] Poor implementation of "clean build" feature for Hg-controlled workspaces

          +1

          Kohsuke Kawaguchi added a comment - +1

          mirlix added a comment -

          +1

          mirlix added a comment - +1

          Code changed in hudson
          User: : jglick
          Path:
          trunk/hudson/plugins/mercurial/src/main/java/hudson/plugins/mercurial/MercurialSCM.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=15221
          Log:
          [FIXED JENKINS-2666] Use proper hg commands to clean a workspace before a new build.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : jglick Path: trunk/hudson/plugins/mercurial/src/main/java/hudson/plugins/mercurial/MercurialSCM.java http://fisheye4.cenqua.com/changelog/hudson/?cs=15221 Log: [FIXED JENKINS-2666] Use proper hg commands to clean a workspace before a new build.

            kohsuke Kohsuke Kawaguchi
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: