[PATCH] subrepo: improve lookup error messages

Martin Geisler mg at lazybytes.net
Sun Sep 26 15:48:48 CDT 2010


Wagner Bruna <wagner.bruna+mercurial at gmail.com> writes:

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

Okay -- nobody came with a better suggestion, so let's go with this one.
Pushed as b4711585a455, thanks!

> 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"
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

-- 
Martin Geisler

Mercurial links: http://mercurial.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100926/6d76a764/attachment.pgp>


More information about the Mercurial-devel mailing list