[PATCH 7 of 7] extdata: abort if external command exits with non-zero status
FUJIWARA Katsunori
foozy at lares.dti.ne.jp
Sun Oct 1 12:15:06 EDT 2017
At Sun, 01 Oct 2017 13:00:18 +0100,
Yuya Nishihara wrote:
>
> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1506856910 -3600
> # Sun Oct 01 12:21:50 2017 +0100
> # Node ID 86c51cf6c4ff8a9a01e34e365c8fbc50415d072e
> # Parent b3a36705720f5ed1e7cc5129b27450ca59c7952b
> extdata: abort if external command exits with non-zero status
>
> It could be a warning, but a warning in template output would be unreadable.
> diff --git a/tests/test-extdata.t b/tests/test-extdata.t
> --- a/tests/test-extdata.t
> +++ b/tests/test-extdata.t
> @@ -12,6 +12,7 @@ test revset support
> > filedata = file:extdata.txt
> > notes = notes.txt
> > shelldata = shell:cat extdata.txt | grep 2
Just nit:
I sometime forget that filtering by grep might cause non-zero exit
code. So, hint like "use `| grep PATTERN | cat` to allow empty
external data" or so will prevent me from falling into a pitfall in
the future :-)
> + > fail = shell:false
> > EOF
> $ cat <<'EOF' > extdata.txt
> > 2 another comment on 2
> @@ -50,6 +51,9 @@ test bad extdata() revset source
> $ hg log -qr "extdata(unknown)"
> abort: unknown extdata source 'unknown'
> [255]
> + $ hg log -qr "extdata(fail)"
> + abort: extdata command 'false' failed: exited with status 1
> + [255]
>
> test template support:
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
--
----------------------------------------------------------------------
[FUJIWARA Katsunori] foozy at lares.dti.ne.jp
More information about the Mercurial-devel
mailing list