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.
Key Facts
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.
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
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.
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.