revisions.

Rebase will destroy original changesets unless you use ``--keep``.
It will also move your bookmarks (even if you do).

Some changesets may be dropped if they do not contribute changes
(e.g. merges from the destination branch).

Unlike ``merge``, rebase will do nothing if you are at the branch tip of
a named branch with two heads. You will need to explicitly specify source
and/or destination.

If you need to use a tool to automate merge/conflict decisions, you
can specify one with ``--tool``, see :hg:`help merge-tools`.
As a caveat: the tool will not be used to mediate when a file was
deleted, there is no hook presently available for this.

If a rebase is interrupted to manually resolve a conflict, it can be
continued with --continue/-c, aborted with --abort/-a, or stopped with
--stop.

.. container:: verbose

  Examples:

  - move "local changes" (current commit back to branching point)
    to the current branch tip after a pull::

      hg rebase

  - move a single changeset to the stable branch::

      hg rebase -r 5f493448 -d stable

  - splice a commit and all its descendants onto another part of history::

      hg rebase --source c0c3 --dest 4cf9

  - rebase everything on a branch marked by a bookmark onto the
    default branch::

      hg rebase --base myfeature --dest default

  - collapse a sequence of changes into a single commit::

      hg rebase --collapse -r 1520:1525 -d .

  - move a named branch while preserving its name::

      hg rebase -r "branch(featureX)" -d 1.3 --keepbranches

  - stabilize orphaned changesets so history looks linear::

      hg rebase -r 'orphan()-obsolete()' -d 'first(max((successors(max(roots(ALLSRC) & ::SRC)^)-obsolete())::) + max(::((roots(ALLSRC) & ::SRC)^)-obsolete()))'

Configuration Options:

You can make rebase require a destination if you set the following config
option::

  [commands]
  rebase.requiredest = True

By default, rebase will close the transaction after each commit. For
performance purposes, you can configure rebase to use a single transaction
across the entire rebase. WARNING: This setting introduces a significant
risk of losing the work you've done in a rebase if the rebase aborts
unexpectedly::

  [rebase]
  singletransaction = True

By default, rebase writes to the working copy, but you can configure it to
run in-memory for better performance. When the rebase is not moving the
parent(s) of the working copy (AKA the "currently checked out changesets"),
this may also allow it to run even if the working copy is dirty::

  [rebase]
  experimental.inmemory = True

Return Values:

Returns 0 on success, 1 if nothing to rebase or there are
unresolved conflicts.

r7