Improved error message for log --follow
authorBrendan Cully <brendan@kublai.com>
Mon, 24 Nov 2008 17:16:39 -0800
changeset 7404 07cb58b8c843
parent 7403 9efd596e4393
child 7405 f1944e74e83c
Improved error message for log --follow Mads Kiilerich notes that the existing message was unclear when a nonexistent file was supplied.
mercurial/cmdutil.py
tests/test-log.out
--- a/mercurial/cmdutil.py	Tue Nov 25 01:22:43 2008 +0100
+++ b/mercurial/cmdutil.py	Mon Nov 24 17:16:39 2008 -0800
@@ -1033,6 +1033,8 @@
                 if node is None:
                     # A zero count may be a directory or deleted file, so
                     # try to find matching entries on the slow path.
+                    if follow:
+                        raise util.Abort(_('cannot follow nonexistent file: "%s"') % file_)
                     slowpath = True
                     break
                 else:
--- a/tests/test-log.out	Tue Nov 25 01:22:43 2008 +0100
+++ b/tests/test-log.out	Mon Nov 24 17:16:39 2008 -0800
@@ -5,7 +5,7 @@
 summary:     a
 
 % -f, directory
-abort: can only follow copies/renames for explicit file names
+abort: cannot follow nonexistent file: "dir"
 % -f, but no args
 changeset:   4:b30c444c7c84
 tag:         tip