Patchwork [3,of,5] cmdutil: reword cannot follow parent revision message

login
register
mail settings
Submitter timeless@mozdev.org
Date Oct. 15, 2015, 9:05 p.m.
Message ID <31bdbd8519204c15d79d.1444943138@waste.org>
Download mbox | patch
Permalink /patch/11121/
State Deferred
Headers show

Comments

timeless@mozdev.org - Oct. 15, 2015, 9:05 p.m.
# HG changeset patch
# User timeless@mozdev.org
# Date 1444856672 14400
#      Wed Oct 14 17:04:32 2015 -0400
# Node ID 31bdbd8519204c15d79d92a8290bc2f48eba8914
# Parent  ea351d6956fc625aa471724ca273615af8bcfafb
cmdutil: reword cannot follow parent revision message
Matt Mackall - Oct. 19, 2015, 10:11 p.m.
On Thu, 2015-10-15 at 16:05 -0500, timeless@mozdev.org wrote:
> # HG changeset patch
> # User timeless@mozdev.org
> # Date 1444856672 14400
> #      Wed Oct 14 17:04:32 2015 -0400
> # Node ID 31bdbd8519204c15d79d92a8290bc2f48eba8914
> # Parent  ea351d6956fc625aa471724ca273615af8bcfafb
> cmdutil: reword cannot follow parent revision message
> 

>    $ testlog -f dir
> -  abort: cannot follow file not in parent revision: "dir"
> -  abort: cannot follow file not in parent revision: "dir"
> -  abort: cannot follow file not in parent revision: "dir"
> +  abort: cannot follow parent revision does not have file: "dir"
> +  abort: cannot follow parent revision does not have file: "dir"
> +  abort: cannot follow parent revision does not have file: "dir"

This actually does not strike me as an improvement. First, it seems to
be missing a comma before "does". Second, we're actually following a
file's history here.

-- 
Mathematics is the supreme nostalgia of our time.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1658,8 +1658,9 @@ 
         for filename in match.files():
             if follow:
                 if filename not in pctx:
-                    raise error.Abort(_('cannot follow file not in parent '
-                                       'revision: "%s"') % filename)
+                    # this is not tested
+                    raise error.Abort(_('cannot follow parent revision '
+                                       'does not have file: "%s"') % filename)
                 yield filename, pctx[filename].filenode()
             else:
                 yield filename, None
@@ -1976,8 +1977,8 @@ 
                     slowpath = True
                     continue
                 else:
-                    raise error.Abort(_('cannot follow file not in parent '
-                                       'revision: "%s"') % f)
+                    raise error.Abort(_('cannot follow parent revision '
+                                       'does not have file: "%s"') % f)
             filelog = repo.file(f)
             if not filelog:
                 # A zero count may be a directory or deleted file, so
diff --git a/tests/test-glog.t b/tests/test-glog.t
--- a/tests/test-glog.t
+++ b/tests/test-glog.t
@@ -1650,9 +1650,9 @@ 
 Test --follow on a non-existent directory
 
   $ testlog -f dir
-  abort: cannot follow file not in parent revision: "dir"
-  abort: cannot follow file not in parent revision: "dir"
-  abort: cannot follow file not in parent revision: "dir"
+  abort: cannot follow parent revision does not have file: "dir"
+  abort: cannot follow parent revision does not have file: "dir"
+  abort: cannot follow parent revision does not have file: "dir"
 
 Test --follow on a directory
 
@@ -1676,9 +1676,9 @@ 
 Test --follow on file not in parent revision
 
   $ testlog -f a
-  abort: cannot follow file not in parent revision: "a"
-  abort: cannot follow file not in parent revision: "a"
-  abort: cannot follow file not in parent revision: "a"
+  abort: cannot follow parent revision does not have file: "a"
+  abort: cannot follow parent revision does not have file: "a"
+  abort: cannot follow parent revision does not have file: "a"
 
 Test --follow and patterns
 
diff --git a/tests/test-log.t b/tests/test-log.t
--- a/tests/test-log.t
+++ b/tests/test-log.t
@@ -101,7 +101,7 @@ 
 -f, non-existent directory
 
   $ hg log -f dir
-  abort: cannot follow file not in parent revision: "dir"
+  abort: cannot follow parent revision does not have file: "dir"
   [255]
 
 -f, directory