diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -738,13 +738,24 @@ actions[f] = ('g', (fl2, True), "remote created") for f in sorted(abortconflicts): - repo.ui.warn(_("%s: untracked file differs\n") % f) + if f in pathconflicts: + if repo.wvfs.isfileorlink(f): + repo.ui.warn(_("%s: untracked file conflicts with directory\n") + % f) + else: + repo.ui.warn(_("%s: untracked directory conflicts with file\n") + % f) + else: + repo.ui.warn(_("%s: untracked file differs\n") % f) if abortconflicts: raise error.Abort(_("untracked files in working directory " "differ from files in requested revision")) for f in sorted(warnconflicts): - repo.ui.warn(_("%s: replacing untracked file\n") % f) + if repo.wvfs.isfileorlink(f): + repo.ui.warn(_("%s: replacing untracked file\n") % f) + else: + repo.ui.warn(_("%s: replacing untracked files in directory\n") % f) for f, (m, args, msg) in actions.iteritems(): if m == 'c': diff --git a/tests/test-merge1.t b/tests/test-merge1.t --- a/tests/test-merge1.t +++ b/tests/test-merge1.t @@ -30,7 +30,7 @@ $ mkdir b && touch b/nonempty $ hg up - b: untracked file differs + b: untracked directory conflicts with file abort: untracked files in working directory differ from files in requested revision [255] $ hg ci diff --git a/tests/test-pathconflicts-basic.t b/tests/test-pathconflicts-basic.t --- a/tests/test-pathconflicts-basic.t +++ b/tests/test-pathconflicts-basic.t @@ -37,7 +37,7 @@ $ mkdir a $ echo 3 > a/b $ hg up file - a: untracked file differs + a: untracked directory conflicts with file abort: untracked files in working directory differ from files in requested revision [255] $ hg up --clean file diff --git a/tests/test-update-names.t b/tests/test-update-names.t --- a/tests/test-update-names.t +++ b/tests/test-update-names.t @@ -50,7 +50,7 @@ $ hg st ? name/file $ hg up 1 - name: untracked file differs + name: untracked directory conflicts with file abort: untracked files in working directory differ from files in requested revision [255] $ cd ..