# HG changeset patch # User Matt Mackall # Date 1303327720 18000 # Node ID f85c9b0fdb3210609e29d1d04f7e69511b7ace78 # Parent a1c31c64bcd30369ef0e7e9a84d46c16276d30a2 dispatch: improve repository not found message This should help clarify what the problem is in various problematic cases like ssh. diff -r a1c31c64bcd3 -r f85c9b0fdb32 mercurial/dispatch.py --- 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: diff -r a1c31c64bcd3 -r f85c9b0fdb32 tests/test-dispatch.t --- 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] diff -r a1c31c64bcd3 -r f85c9b0fdb32 tests/test-globalopts.t --- 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: diff -r a1c31c64bcd3 -r f85c9b0fdb32 tests/test-i18n.t --- 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]