damio damio - 2 years ago 133
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 Source

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.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download