damio damio - 6 months ago 19
Bash Question

Mercurial patch import via pipe

I would like to avoid avoid a file on disk when applying a patch with mercurial

Instead of

./script_gen_diff > diff && hg import diff && rm diff
, I would like to be able to
./script_gen_diff | hg import
. Is it possible ? There's no such option in the doc.

Answer

There's no such option in the doc

RLLY?! I can read hg help import and discover

hg import [OPTION]... PATCH ...

...

To read a patch from standard input, use "-" as the patch name. If a URL
is specified, the patch will be downloaded from there.
Comments