# HG changeset patch # User Mads Kiilerich # Date 1453055582 -3600 # Node ID 78b9fdb844c1e571ccf615fdf85a4a4eed6b21c1 # Parent 2cc44efcb7cf94f0e7d58f7e8767c405609804d6 graft: warn when -r is combined with revisions as positional arguments The behaviour in this case is undefined. Instead of silently doing something "random" and surprising, at least issue a warning. (This should perhaps be considered a "deprecation" and turned into an error in a future release.) diff -r 2cc44efcb7cf -r 78b9fdb844c1 mercurial/commands.py --- a/mercurial/commands.py Sun Jan 17 19:33:02 2016 +0100 +++ b/mercurial/commands.py Sun Jan 17 19:33:02 2016 +0100 @@ -3889,6 +3889,10 @@ 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 -r 2cc44efcb7cf -r 78b9fdb844c1 tests/test-graft.t --- a/tests/test-graft.t Sun Jan 17 19:33:02 2016 +0100 +++ b/tests/test-graft.t Sun Jan 17 19:33:02 2016 +0100 @@ -62,6 +62,7 @@ [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]