damio damio - 5 months ago 11
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.


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.