[PATCH] subrepo: improve lookup error messages

Wagner Bruna wagner.bruna+mercurial at gmail.com
Mon Sep 13 08:38:48 CDT 2010


# HG changeset patch
# User Wagner Bruna <wbruna at softwareexpress.com.br>
# Date 1284384829 10800
# Node ID 3c3084b99393865ad9d6188ce179d3d7baa369fa
# Parent  88a42bf5fa46d5ec5f5d1601b8e6d2a643c917ca
subrepo: improve lookup error messages

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -310,7 +310,7 @@
             ctx2 = self._repo[rev2]
             return self._repo.status(ctx1, ctx2, **opts)
         except error.RepoLookupError, inst:
-            self._repo.ui.warn(_("warning: %s in %s\n")
+            self._repo.ui.warn(_('warning: error "%s" in subrepository "%s"\n')
                                % (inst, relpath(self)))
             return [], [], [], [], [], [], []
 
@@ -326,7 +326,7 @@
                                    prefix=os.path.join(prefix, self._path),
                                    listsubrepos=True, **opts)
         except error.RepoLookupError, inst:
-            self._repo.ui.warn(_("warning: %s in %s\n")
+            self._repo.ui.warn(_('warning: error "%s" in subrepository "%s"\n')
                                % (inst, relpath(self)))
 
     def dirty(self):
diff --git a/tests/test-subrepo-recursion.t b/tests/test-subrepo-recursion.t
--- a/tests/test-subrepo-recursion.t
+++ b/tests/test-subrepo-recursion.t
@@ -320,4 +320,4 @@
 
   $ rm -r foo
   $ hg status
-  warning: unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98' in foo
+  warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"


More information about the Mercurial-devel mailing list