Rebase topic streams

If you have a topic and parent stream that both contain changes, and you want to update the topic stream with the changes from its parent, you can rebase the topic stream.

Rebase guidelines

  • Rebase updates the content of the topic stream with the tip of the parent stream (or an earlier version).

  • Rebase merges the changes from the selected parent stream version, with all the changesets in the topic stream, into a single changeset on the topic stream.

  • Rebase is simpler and quicker than merging the streams. The rebase is performed in the repository and not via the work area.

  • Rebase is particularly useful when development work on a topic stream is taking a long time and you want to test your code with the latest updates in the parent stream.

  • Rebase makes reviews of changes simpler.

  • Rebase only works if there are no conflicts between the topic and mainline streams.

Back to top

Rebase a topic stream

Rebase updates the content of the topic stream with the tip of the parent stream (or an earlier version).

To rebase from a stream:

  1. In the desktop client, open a topic stream.

  2. Select a stream from which to rebase.

  3. (Optional) To rebase from an earlier version of the stream, click Select Version. Use the filters and date range to search for a specific version.

  4. Click Rebase.

Back to top

Rebase scenario

The following example describes a scenario of rebasing a topic stream.

  1. A topic stream is created from a parent stream. Deliveries are made to both streams, which creates multiple changesets:

    • Parent stream changesets: p1, p2, p3

    • Topic stream changesets: t1,t2

      rebase_workflow-1.png

  2. Solution 1: merge

    • Merging changes from the parent into the topic stream via the work area creates a new changeset, t3, in the topic stream that includes all the changes from the parent stream.

    • The pull request for the topic stream includes the results of the merge, which makes it hard to see the real changes in the topic stream.

      rebase_workflow-2.png

  3. Solution 2: rebase

    • Rebasing merges all the changesets in the parent stream (p1, p2, p3) into a new changeset on the topic stream, t1’.

    • Rebase then merges the topic stream changesets (t1, t2) into a new changeset, t2’.

    • The pull request for the topic stream looks cleaner as it does not include the changes from p2 and p3 in the parent stream.

      rebase_workflow-3.png

Back to top