changeset 13967:f85c9b0fdb32

dispatch: improve repository not found message This should help clarify what the problem is in various problematic cases like ssh.
author Matt Mackall <mpm@selenic.com>
date Wed, 20 Apr 2011 14:28:40 -0500
parents a1c31c64bcd3
children 336bb8b53ad0
files mercurial/dispatch.py tests/test-dispatch.t tests/test-globalopts.t tests/test-i18n.t
diffstat 4 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dispatch.py	Wed Apr 20 00:01:50 2011 -0400
+++ b/mercurial/dispatch.py	Wed Apr 20 14:28:40 2011 -0500
@@ -586,8 +586,8 @@
                     if guess and repos.count(guess) == len(repos):
                         return _dispatch(ui, ['--repository', guess] + fullargs)
                 if not path:
-                    raise error.RepoError(_("There is no Mercurial repository"
-                                      " here (.hg not found)"))
+                    raise error.RepoError(_("no repository found in %r"
+                                            " (.hg not found)") % os.getcwd())
                 raise
         args.insert(0, repo)
     elif rpath:
--- a/tests/test-dispatch.t	Wed Apr 20 00:01:50 2011 -0400
+++ b/tests/test-dispatch.t	Wed Apr 20 14:28:40 2011 -0500
@@ -47,6 +47,6 @@
 
   $ cd $dir
   $ hg cat
-  abort: There is no Mercurial repository here (.hg not found)!
+  abort: no repository found in '$TESTTMP' (.hg not found)!
   [255]
 
--- a/tests/test-globalopts.t	Wed Apr 20 00:01:50 2011 -0400
+++ b/tests/test-globalopts.t	Wed Apr 20 14:28:40 2011 -0500
@@ -84,13 +84,13 @@
   $ hg ann a/a a/a
   0: a
   $ hg ann a/a b/b
-  abort: There is no Mercurial repository here (.hg not found)!
+  abort: no repository found in '$TESTTMP' (.hg not found)!
   [255]
   $ hg -R b ann a/a
   abort: a/a not under root
   [255]
   $ hg log
-  abort: There is no Mercurial repository here (.hg not found)!
+  abort: no repository found in '$TESTTMP' (.hg not found)!
   [255]
 
 Abbreviation of long option:
--- a/tests/test-i18n.t	Wed Apr 20 00:01:50 2011 -0400
+++ b/tests/test-i18n.t	Wed Apr 20 14:28:40 2011 -0500
@@ -8,17 +8,17 @@
 using the "replace" error handler:
 
   $ LANGUAGE=pt_BR hg tip
-  abortado: N?o h? um reposit?rio do Mercurial aqui (.hg n?o encontrado)!
+  abortado: no repository found in '$TESTTMP' (.hg not found)!
   [255]
 
 Using a more accomodating encoding:
 
   $ HGENCODING=UTF-8 LANGUAGE=pt_BR hg tip
-  abortado: N\xc3\xa3o h\xc3\xa1 um reposit\xc3\xb3rio do Mercurial aqui (.hg n\xc3\xa3o encontrado)! (esc)
+  abortado: no repository found in '$TESTTMP' (.hg not found)!
   [255]
 
 Different encoding:
 
   $ HGENCODING=Latin-1 LANGUAGE=pt_BR hg tip
-  abortado: N\xe3o h\xe1 um reposit\xf3rio do Mercurial aqui (.hg n\xe3o encontrado)! (esc)
+  abortado: no repository found in '$TESTTMP' (.hg not found)!
   [255]