If I read the help page for 'hg up' correctly, the '--check' option should abort when uncommitted changes are encountered. With hg 1.6.4 on both OS X and Linux, however, '--check' overwrites unversioned files with a versioned copy if they happen to have the same name. With an unversioned file, I would expect the following: 'hg up': abort 'hg up --check': abort 'hg up --clean': overwrite Actually, what happens is: 'hg up': abort 'hg up --check': overwrite (!) 'hg up --clean': overwrite Please see the attached shell script for a minimal test case.
Unified test: $ hg init foo $ echo foo > foo/file $ hg -R foo ci -Am'foo' adding file create non-repo dir in bar $ mkdir bar $ echo bar > bar/file # same filename as in foo try to retrofit repo into bar $ hg init bar $ hg -R bar pull -q foo $ hg -R bar up # aborts with 'untracked file' abort: untracked file in working directory differs from file in requested revision: 'file' [255] $ hg -R bar up --check # replaces uncommitted file with hg copy! 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat {foo,bar}/file foo foo
Copy nosy from Issue2845
Fixed by http://selenic.com/repo/hg/rev/914bc95e227b Matt Mackall <mpm@selenic.com> update: use normal update path with --check (issue2450) (please test the fix)
--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:13 EDT --- This bug was previously known as _bug_ 2450 at http://mercurial.selenic.com/bts/issue2450 Imported an attachment (id=1474)