diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -628,6 +628,9 @@ def tryimportone(ui, repo, hunk, parents p2 = repo[nullid] except error.RepoError: p1, p2 = parents + if p2.node() == nullid: + ui.warn(_("warning: import the patch as a normal revision\n" + "(use --exact to import the patch as a merge)\n")) else: p1, p2 = parents diff --git a/tests/test-import-merge.t b/tests/test-import-merge.t --- a/tests/test-import-merge.t +++ b/tests/test-import-merge.t @@ -66,6 +66,8 @@ Test without --exact and diff.p1 != work 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg import ../merge.diff applying ../merge.diff + warning: import the patch as a normal revision + (use --exact to import the patch as a merge) $ tipparents 2:890ecaa90481 addc $ hg strip --no-backup tip @@ -99,6 +101,8 @@ Test with --bypass and diff.p1 != workin 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg import --bypass ../merge.diff applying ../merge.diff + warning: import the patch as a normal revision + (use --exact to import the patch as a merge) $ tipparents 2:890ecaa90481 addc $ hg strip --no-backup tip