import: mention "stdin" (abbreviated) and add example

I actually didn't even think it was possible because I searched the
help text for "stdin", and didn't even think of searching for
"standard input". Let's mention the abbreviated form too to help
others like me. (When importing from stdin, we actually print a
message saying "applying patch from stdin".)

This patch also adds an example showing how to import from stdin.
This commit is contained in:
Martin von Zweigbergk 2017-02-10 15:26:03 -08:00
parent d96c319788
commit 98ebae390c

View File

@ -4129,8 +4129,9 @@ def import_(ui, repo, patch1=None, *patches, **opts):
Import a list of patches and commit them individually (unless
--no-commit is specified).
To read a patch from standard input, use "-" as the patch name. If
a URL is specified, the patch will be downloaded from there.
To read a patch from standard input (stdin), use "-" as the patch
name. If a URL is specified, the patch will be downloaded from
there.
Import first applies changes to the working directory (unless
--bypass is specified), import will abort if there are outstanding
@ -4200,6 +4201,10 @@ def import_(ui, repo, patch1=None, *patches, **opts):
hg import incoming-patches.mbox
- import patches from stdin::
hg import -
- attempt to exactly restore an exported changeset (not always
possible)::