diff --git a/mercurial/commands.py b/mercurial/commands.py
index 5c7dbb73017996a25ca8b1c7d3391cef6b845c71_bWVyY3VyaWFsL2NvbW1hbmRzLnB5..2e45bbd3db7bab742cddcf15798759b65177df5f_bWVyY3VyaWFsL2NvbW1hbmRzLnB5 100644
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -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']
diff --git a/tests/test-log-linerange.t b/tests/test-log-linerange.t
index 5c7dbb73017996a25ca8b1c7d3391cef6b845c71_dGVzdHMvdGVzdC1sb2ctbGluZXJhbmdlLnQ=..2e45bbd3db7bab742cddcf15798759b65177df5f_dGVzdHMvdGVzdC1sb2ctbGluZXJhbmdlLnQ= 100644
--- a/tests/test-log-linerange.t
+++ b/tests/test-log-linerange.t
@@ -288,6 +288,6 @@
   +4
   
 
-Regular file patterns are allowed with -L and their diff shows all lines.
+Regular file patterns are not allowed.
 
   $ hg log -f -L foo,5:7 -p bar
@@ -292,60 +292,7 @@
 
   $ hg log -f -L foo,5:7 -p bar
-  changeset:   5:cfdf972b3971
-  tag:         tip
-  user:        test
-  date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
-  
-  diff --git a/bar b/bar
-  --- a/bar
-  +++ b/bar
-  @@ -1,4 +1,4 @@
-  -a
-  +a+
-   b
-   c
-   d
-  diff --git a/foo b/foo
-  --- a/foo
-  +++ b/foo
-  @@ -4,7 +4,7 @@
-   0
-    1
-   2+
-  -3
-  +3+
-   4
-   5
-   6
-  
-  changeset:   2:63a884426fd0
-  user:        test
-  date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     2 -> 2+; added bar
-  
-  diff --git a/bar b/bar
-  new file mode 100644
-  --- /dev/null
-  +++ b/bar
-  @@ -0,0 +1,5 @@
-  +a
-  +b
-  +c
-  +d
-  +e
-  diff --git a/foo b/foo
-  --- a/foo
-  +++ b/foo
-  @@ -3,6 +3,6 @@
-   0
-   0
-   1
-  -2
-  +2+
-   3
-   4
-  
+  abort: FILE arguments are not compatible with --line-range option
+  [255]
 
 Option --rev acts as a restriction.