If I have two streams(called Stream1, Stream2) of development and I want to merge these two streams into one stream.
This is currently how I do it :
Is this best practice for merging 2 or more streams or is there more elegant method?
With three streams we could write Stream. concat(Stream. concat(a, b), c) .
Stream. concat() method creates a concatenated stream in which the elements are all the elements of the first stream followed by all the elements of the second stream. The resulting stream is ordered if both of the input streams are ordered, and parallel if either of the input streams is parallel. The calls to Stream.
3.1. Merging Streams. Since it is an instance method, we can easily chain it and append multiple streams. Note that we could also create a List out of the stream by using toList() if we type the resultingStream variable to the StreamEx type.
The concat() method is a static method of the Stream Interface that can be used to merge two streams into a single stream. The merged stream contains all the elements of the first stream, followed by all the elements of the second stream. If both the streams are ordered, then the merged stream will be ordered.
Create a new stream??? No need.
When you open a repo workspace, you have a section called "Flow targets", which contains by your Stream (characterized as "Default").
Add to it the Stream source (the Stream from which you want to merge), set it as "current", and you will see in your "Pending changes" view an "Incoming" section with all the change sets or baselines coming from that source Stream.
The idea is for you to accept those change set, load them in your local workspace and test them (compilation and test), and then deliver them back to your default stream.
The "Accept" phase is where the merge occurs (automatically, or manually if conflicts).
As mentioned in this thread:
The merge algorithm in RTC is logically the same as is found in ClearCase, i.e., given a configuration (stream, workspace) that selects a different version of a given file, find the common ancestor of the two versions, and then do a 3-way merge.
Changing the "flow target" of a workspace is just RTC's way of letting you specify what branch (stream) you want to merge into your workspace (cleartool findmerge
gives you the same flexibility).
Note that ClearCase and RTC use a different common ancestor algorithm.
The last step supposes you go back to your "Flow target" section, and set back as "current" the default Stream.
I prefer this workflow to this one:
Here Brent would set as current the destination stream in order to deliver the result of the merge. That is an alternative workflow, also described in "How to keep your streams flowing smoothly in Rational Team Concert 3.0.1".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With