mercurial/commands.py
changeset 34906 2e45bbd3db7b
parent 34905 5c7dbb730179
child 34920 6a0e1d593bdd
--- a/mercurial/commands.py	Thu Oct 19 12:37:26 2017 +0200
+++ b/mercurial/commands.py	Thu Oct 19 14:12:49 2017 +0200
@@ -3383,6 +3383,11 @@
     if linerange and not opts.get('follow'):
         raise error.Abort(_('--line-range requires --follow'))
 
+    if linerange and pats:
+        raise error.Abort(
+            _('FILE arguments are not compatible with --line-range option')
+        )
+
     if opts.get('follow') and opts.get('rev'):
         opts['rev'] = [revsetlang.formatspec('reverse(::%lr)', opts.get('rev'))]
         del opts['follow']