diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -3889,6 +3889,10 @@ def graft(ui, repo, *revs, **opts): return _dograft(ui, repo, *revs, **opts) def _dograft(ui, repo, *revs, **opts): + if revs and opts['rev']: + ui.warn(_('warning: inconsistent use of --rev might give unexpected ' + 'revision ordering!\n')) + revs = list(revs) revs.extend(opts['rev']) diff --git a/tests/test-graft.t b/tests/test-graft.t --- a/tests/test-graft.t +++ b/tests/test-graft.t @@ -62,6 +62,7 @@ Specify revisions with -r: [255] $ hg graft -r 1 2 + warning: inconsistent use of --rev might give unexpected revision ordering! skipping ancestor revision 2:5c095ad7e90f skipping ancestor revision 1:5d205f8b35b6 [255]