et will be created from the patch
even if some hunks fail to apply. Hunks that fail to apply will be
written to a <target-file>.rej file. Conflicts can then be resolved
by hand before :hg:`commit --amend` is run to update the created
changeset. This flag exists to let people import patches that
partially apply without losing the associated metadata (author,
date, description, ...).

.. note::

   When no hunks apply cleanly, :hg:`import --partial` will create
   an empty changeset, importing only the patch metadata.

With -s/--similarity, hg will attempt to discover renames and
copies in the patch in the same way as :hg:`addremove`.

It is possible to use external patch programs to perform the patch
by setting the ``ui.patch`` configuration option. For the default
internal tool, the fuzz can also be configured via ``patch.fuzz``.
See :hg:`help config` for more information about configuration
files and how to use these options.

See :hg:`help dates` for a list of formats valid for -d/--date.

.. container:: verbose

  Examples:

  - import a traditional patch from a website and detect renames::

      hg import -s 80 http://example.com/bugfix.patch

  - import a changeset from an hgweb server::

      hg import https://www.mercurial-scm.org/repo/hg/rev/5ca8c111e9aa

  - import all the patches in an Unix-style mbox::

      hg import incoming-patches.mbox

  - import patches from stdin::

      hg import -

  - attempt to exactly restore an exported changeset (not always
    possible)::

      hg import --exact proposed-fix.patch

  - use an external tool to apply a patch which is too fuzzy for
    the default internal tool.

      hg import --config ui.patch="patch --merge" fuzzy.patch

  - change the default fuzzing from 2 to a less strict 7

      hg import --config ui.fuzz=7 fuzz.patch

Returns 0 on success, 1 on partial success (see --partial).
r8