diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -298,8 +298,7 @@ class mergestate(object): return r def _checkunknownfile(repo, wctx, mctx, f): - return (not repo.dirstate._ignore(f) - and os.path.isfile(repo.wjoin(f)) + return (os.path.isfile(repo.wjoin(f)) and repo.wopener.audit.check(f) and repo.dirstate.normalize(f) not in repo.dirstate and mctx[f].cmp(wctx[f])) diff --git a/tests/test-up-local-change.t b/tests/test-up-local-change.t --- a/tests/test-up-local-change.t +++ b/tests/test-up-local-change.t @@ -231,8 +231,6 @@ test conflicting untracked files test conflicting untracked ignored file -BROKEN: the ignored file gets overwritten by the remote version - $ hg up -qC 0 $ echo ignored > .hgignore $ hg add .hgignore @@ -246,9 +244,9 @@ BROKEN: the ignored file gets overwritte $ echo untracked > ignored $ hg st $ hg up 'desc("add ignored file")' - 1 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ cat ignored - ignored + ignored: untracked file differs + abort: untracked files in working directory differ from files in requested revision + [255] test a local add