 been grafted, or that are merges will be skipped.

If --log is specified, log messages will have a comment appended
of the form::

  (grafted from CHANGESETHASH)

If --force is specified, revisions will be grafted even if they
are already ancestors of, or have been grafted to, the destination.
This is useful when the revisions have since been backed out.

If a graft merge results in conflicts, the graft process is
interrupted so that the current merge can be manually resolved.
Once all conflicts are addressed, the graft process can be
continued with the -c/--continue option.

The -c/--continue option reapplies all the earlier options.

.. container:: verbose

  The --base option exposes more of how graft internally uses merge with a
  custom base revision. --base can be used to specify another ancestor than
  the first and only parent.

  The command::

    hg graft -r 345 --base 234

  is thus pretty much the same as::

    hg diff --from 234 --to 345 | hg import

  but using merge to resolve conflicts and track moved files.

  The result of a merge can thus be backported as a single commit by
  specifying one of the merge parents as base, and thus effectively
  grafting the changes from the other side.

  It is also possible to collapse multiple changesets and clean up history
  by specifying another ancestor as base, much like rebase --collapse
  --keep.

  The commit message can be tweaked after the fact using commit --amend .

  For using non-ancestors as the base to backout changes, see the backout
  command and the hidden --parent option.

.. container:: verbose

  Examples:

  - copy a single change to the stable branch and edit its description::

      hg update stable
      hg graft --edit 9393

  - graft a range of changesets with one exception, updating dates::

      hg graft -D "2085::2093 and not 2091"

  - continue a graft after resolving conflicts::

      hg graft -c

  - show the source of a grafted changeset::

      hg log --debug -r .

  - show revisions sorted by date::

      hg log -r "sort(all(), date)"

  - backport the result of a merge as a single commit::

      hg graft -r 123 --base 123^

  - land a feature branch as one changeset::

      hg up -cr default
      hg graft -r featureX --base "ancestor('featureX', 'default')"

See :hg:`help revisions` for more about specifying revisions.

Returns 0 on successful completion, 1 if there are unresolved files.
N)