I just noticed that the strip command destroys any modifications outstanding in the working directory, and not in a good way. For example, I "hg add"ed a file, and it got removed. Eep! It should presumably barf if there are pending changes, but even if passed a -f flag, it should at most *forget* added files etc, not outright delete them.
This looks related to http://www.serpentine.com/bugzilla/show_bug.cgi?id=296 which I posted a couple of weeks ago. Perhaps strip shouldn't touch the working directory at all?
It should probably abort with outstanding modifications if the rev is included in the stripped revs (otherwise we shouldn't care)
should be fixed by f8bcaf5696d5761e823a821b48fbf7bf1f0ad94a
tested with main
It shouldn't do anything with local changes. IMO, the following sequence of operations should work the same with or without the explicit "hg update" step: hg init repo1 cd repo1 echo foo > foo hg add foo hg ci -m rev1 echo bar >> foo hg ci -m rev2 echo groo >> foo # change the file, but don't commit it # Without this, strip throws away changes: hg update -r 0 hg strip -f 1
fwiw, I just tried this with hg 1.5.2, and it still throws away working directory changes.
Fixed by http://selenic.com/repo/hg/rev/4f19242dac6c Patrick Mezard <pmezard@gmail.com> strip: make it clear that --force discards changes (issue310) (please test the fix)
--- Bug imported by bugzilla@serpentine.com 2012-05-12 08:32 EDT --- This bug was previously known as _bug_ 310 at http://mercurial.selenic.com/bts/issue310