changeset 23045:a4dd270a419c

repoview: include the filter name in filtered revision error messages This will help user to debug. A more precise message will be issued for the most common case ("visible" filter) in the next changesets. example output: - abort: filtered revision '4'! + abort: filtered revision '4' (not in 'visible' subset)!
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 17 Oct 2014 15:54:43 -0700
parents 075f55a9c488
children c1aede895072
files mercurial/context.py tests/test-hgweb-commands.t tests/test-log.t tests/test-obsolete.t
diffstat 4 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Wed Oct 15 05:08:56 2014 +0200
+++ b/mercurial/context.py	Fri Oct 17 15:54:43 2014 -0700
@@ -469,8 +469,9 @@
                 pass
         except (error.FilteredIndexError, error.FilteredLookupError,
                 error.FilteredRepoLookupError):
-            raise error.FilteredRepoLookupError(_("filtered revision '%s'")
-                                                % changeid)
+            msg = _("filtered revision '%s' (not in '%s' subset)")
+            msg %= (changeid, repo.filtername)
+            raise error.FilteredRepoLookupError(msg)
         except IndexError:
             pass
         raise error.RepoLookupError(
--- a/tests/test-hgweb-commands.t	Wed Oct 15 05:08:56 2014 +0200
+++ b/tests/test-hgweb-commands.t	Fri Oct 17 15:54:43 2014 -0700
@@ -2175,7 +2175,7 @@
   Content-Type: text/plain; charset=ascii\r (esc)
   \r (esc)
   
-  error: filtered revision '5'
+  error: filtered revision '5' (not in 'served' subset)
 
 
 
@@ -2189,7 +2189,7 @@
   Content-Type: text/plain; charset=ascii\r (esc)
   \r (esc)
   
-  error: filtered revision '4'
+  error: filtered revision '4' (not in 'served' subset)
 
 filtered '0' changeset
 
--- a/tests/test-log.t	Wed Oct 15 05:08:56 2014 +0200
+++ b/tests/test-log.t	Fri Oct 17 15:54:43 2014 -0700
@@ -1393,7 +1393,7 @@
   1:a765632148dc55d38c35c4f247c618701886cb2f
   0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
   $ hg log -r a
-  abort: filtered revision 'a'!
+  abort: filtered revision 'a' (not in 'visible' subset)!
   [255]
 
 test that parent prevent a changeset to be hidden
--- a/tests/test-obsolete.t	Wed Oct 15 05:08:56 2014 +0200
+++ b/tests/test-obsolete.t	Fri Oct 17 15:54:43 2014 -0700
@@ -182,7 +182,7 @@
   abort: unknown revision '6'!
   [255]
   $ hg log -r 4
-  abort: filtered revision '4'!
+  abort: filtered revision '4' (not in 'visible' subset)!
   [255]
 
 Check that public changeset are not accounted as obsolete: