Issue Details (XML | Word | Printable)

Key: HUDSON-2666
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: kohsuke
Reporter: jglick
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Hudson

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

Created: 24/Nov/08 07:04 AM   Updated: 10/Feb/09 04:28 PM   Resolved: 10/Feb/09 04:28 PM
Component/s: mercurial
Affects Version/s: current
Fix Version/s: None

Environment: Platform: All, OS: All


 Description  « Hide

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.



Sort Order: Ascending order - Click to sort in descending order
kohsuke added a comment - 08/Dec/08 10:18 AM

+1


mirlix added a comment - 09/Feb/09 08:02 AM

+1


scm_issue_link added a comment - 10/Feb/09 04:28 PM

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 HUDSON-2666] Use proper hg commands to clean a workspace before a new build.