Comments
Patch
@@ -1065,6 +1065,10 @@ def extdatasource(repo, source):
finally:
if proc:
proc.communicate()
+ if proc.returncode != 0:
+ # not an error so 'cmd | grep' can be empty
+ repo.ui.debug("extdata command '%s' %s\n"
+ % (cmd, util.explainexit(proc.returncode)[0]))
if src:
src.close()
@@ -12,6 +12,7 @@ test revset support
> filedata = file:extdata.txt
> notes = notes.txt
> shelldata = shell:cat extdata.txt | grep 2
+ > emptygrep = shell:cat extdata.txt | grep empty
> EOF
$ cat <<'EOF' > extdata.txt
> 2 another comment on 2
@@ -42,6 +43,12 @@ test weight of extdata() revset
(symbol '3'))
3
+test non-zero exit of shell command
+
+ $ hg log -qr "extdata(emptygrep)"
+ $ hg log -qr "extdata(emptygrep)" --debug
+ extdata command 'cat extdata.txt | grep empty' exited with status * (glob)
+
test bad extdata() revset source
$ hg log -qr "extdata()"