mercurial/cmdutil.py
changeset 34907 0ccfc468423a
parent 34905 5c7dbb730179
child 34928 362096cfdb1f
--- a/mercurial/cmdutil.py	Thu Oct 19 14:12:49 2017 +0200
+++ b/mercurial/cmdutil.py	Thu Oct 19 14:55:10 2017 +0200
@@ -2627,6 +2627,9 @@
     # Two-levels map of "rev -> file ctx -> [line range]".
     linerangesbyrev = {}
     for fname, (fromline, toline) in _parselinerangelogopt(repo, opts):
+        if fname not in wctx:
+            raise error.Abort(_('cannot follow file not in parent '
+                                'revision: "%s"') % fname)
         fctx = wctx.filectx(fname)
         for fctx, linerange in dagop.blockancestors(fctx, fromline, toline):
             rev = fctx.introrev()