[PATCH V2] logtoprocess: new experimental extension

Matt Harbison mharbison72 at gmail.com
Fri Apr 15 23:43:52 EDT 2016


On Tue, 05 Apr 2016 13:31:08 -0400, Martijn Pieters <mj at zopatista.com>  
wrote:

> # HG changeset patch
> # User Martijn Pieters <mjpieters at fb.com>
> # Date 1459874399 -3600
> #      Tue Apr 05 17:39:59 2016 +0100
> # Node ID ee2dd1a3f2e15b92b4d7f525443e442c08399ec1
> # Parent  1e97bcbb87767e1a96909900595a0b6a7791407b
> logtoprocess: new experimental extension
>
> This extension lets you direct specific ui.log() information to shell
> commands, spawned in the background. This can be used to, say, capture
> timings, commandfailure tracebacks, etc., making the output available
> to other command-line tools.
>
...

> +
> +Running a command triggers both a ui.log('command') and a
> +ui.log('commandfinish') call. The foo command also uses ui.log.
> +
> +Use head to ensure we wait for all lines to be produced, and sort to  
> avoid
> +ordering issues between the various processes we spawn:
> +  $ hg foo | head -n 17 | sort
> +
> +
> +
> +  0
> +  a message: spam
> +  command
> +  commandfinish
> +  foo
> +  foo
> +  foo
> +  foo
> +  foo exited 0 after * seconds (glob)
> +  logtoprocess command output:
> +  logtoprocess commandfinish output:
> +  logtoprocess foo output:
> +  spam

FWIW, I'm not seeing any output from this command on Windows 7.  The exit  
code is still 0.


More information about the Mercurial-devel mailing list