Jump to content

Integrating Grandchild Branch Loses Child Items


ricko

Recommended Posts

Using release 2.9.174.0, I am trying to set up procedures for using Plastic SCM based on the recent Branching Strategies blog post at http://codicesoftware.blogspot.com/2010/03/branching-strategies.html.

As part of the process, I am trying to use a basic procedure that can be modeled as follows:

1) Start with a new workspace on a new repository.

2) Create a child branch with Changeset 0 as its base. (This creates Changeset 1 on /main/child.)

3) Switch to /main/child.

4) Add file1.txt to the root directory and check it in. (This creates Changeset 2 on /main/child.)

5) Create a grandchild branch with Changeset 2 as its base. (This creates Changeset 3 on /main/child/grandchild.)

6) Switch to /main/child/grandchild.

7) Add file2.txt to the root directory and check it in. (This creates Changeset 4 on /main/child/grandchild.)

8) Switch back to /main.

9) Merge from /main/child/grandchild. The item file2.txt is found for merging, but not file1.txt.

I could not find any sensible way to get Merge to also integrate file1.txt back into /main without first integrating from the child branch also. In the Branching Strategies sense, I want to avoid integrating directly from /main/develop to /main; instead I want the changes to go through /main/develop/release and integrate directly back to /main from there. But Merge does not seem to catch the changes on /main/develop in that case.

Is this the expected behavior? Do you always have to merge back to the parent branch, and not the grandparent branch?

I considered forcing check-ins of all files modified on /main/child into /main/child/grandchild, to get those files explicitly onto the grandchild branch. I also considered using a selector rule for the grandchild branch with checkout on the main branch, to try to operate on /main while seeing the content on /main/child/grandchild. But nothing workable presented itself.

The bottom line is that I see all the files in the workspace when using this selector rule: path

Link to comment
Share on other sites

I've already replied to Rick via email but for anyone else who runs across this here is what is going on:

This situation is a little tricky but it is expected behavior which is by design and has to do with two specific aspects of Plastic which is how branch content is stored and how directories are versioned.

Here is what is happening.

/main -- nothing happens here

/main/branch1 -- add file1.txt

/main/branch1/branch2 -- change file1.txt

When you merge branch2 to main the file1.txt doesn

Link to comment
Share on other sites

Based on Pat's response, I took another stab at it, this time trying to merge just the directory changes from the child branch to the main branch. That did not work out either, and would not be a convenient in any case.

So I modified the process to this, and everything works nicely as I expect:

1) Start with a new workspace on a new repository.

2) Create a childA branch with Changeset 0 as its base. (This creates Changeset 1 on /main/childA.)

3) Switch to /main/childA.

4) Add file1.txt to the root directory and check it in. (This creates Changeset 2 on /main/childA.)

5) Create a childB branch with Changeset 0 as its base. (This creates Changeset 3 on /main/childB.)

6) Switch to /main/childB.

7) Merge from /main/childA. (This creates Changeset 4 on /main/childB.)

8) Add file2.txt to the root directory and check it in. (This creates Changeset 5 on /main/childB.)

9) Switch back to /main.

10) Merge from /main/childB. Now both file1.txt and file2.txt are merged (with no concern about changes on childA following step 7).

Notice that there is now a new step (number 7), but everything works simply without fighting the tool.

I think merging directly from a "grandchild" branch should generally be limited to the cherry-picking type of integration, at least when it may involve changing the directory contents. Otherwise the resulting behavior can be non-intuitive.

Thanks!

\:d/

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...