Merge Branch Issues

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
rudrvij
Posts: 10
Joined: Wed Apr 12, 2006 1:57 pm

Merge Branch Issues

Post by rudrvij » Fri Apr 14, 2006 3:29 pm

Hello,

I am evaluating Vault 3.18. And I am having issues with Merging Branch to the trunk.

This is what I did so far.
TRUNK
I added a project on my computer to the Vault Source Control at this location:$\Projects\TestVault4\trunk\{Project Name}

BRANCH
At this point I created a branch. (My intention in creating this branch is to have my version 1 release code in this branch and if I have to fix some bugs in my Version 1, I would make the changes here while doing my enhancements for Version 2 in the trunk). I created branch from the trunk at this location:
$\Projects\TestVault4\branches\1.0\{Project Name}

In the vault CLinet, I observed that it created all the files in the branch but the status for all of them is missing. I don't know if this is normal.

Making Changes to Version 2 (TRUNK)
From my VS Studio on my machine I opened the project from Source COntrol and selected the project in trunk and added a bunch of files and edited some existing files and deleted a file.

In the Vault CLient, I can see all the changes I did in trunk and not in the branch.

Fixing some errors in Version 1 (BRANCH)
Let us assume that I am working on the Enhancements and suddenly I had to fix the errors in Version 1. So I deleted my local project on my machine. And I used Source Control to connect to the branch version. Here I added a few files, folders and edited the same file I edited in the previous step.

In the Vault Client, I can see all the changes I did in the branch and not in the trunk.

MERGING FROM BRANCH(ORIGIN) TO TRUNK(TARGET)
And now I wanted to merge the changes in the Branch to the Trunk. I used the merge tool and did the merge.

In the Vault Clinet, I can see all the merged changes in the TRUNK

And I deleted the project again on my machine and I tried to open the project from the Source Control but this time I connected to the TRUNK. And when I get Latest Version, I do not see any of the new files. But I see in my Vault CLient.

Any suggestions?

Thanks
rudrvij

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Fri Apr 14, 2006 4:07 pm

In the vault CLinet, I observed that it created all the files in the branch but the status for all of them is missing. I don't know if this is normal.
Branching creates a new folder in the tree, but does not automatically create and fetch files to a working folder. "Missing" means the file is not in the working directory.
this time I connected to the TRUNK. And when I get Latest Version, I do not see any of the new files. But I see in my Vault CLient.
When changes were made the Trunk project, the Visual Studio project file may not have been merged or updated to reflect the new files. So Visual Studio is unaware of the additions. You could manually edit the project file to add the new file names.

Another workaround would be to fetch the new files into the working folder with the Vault GUI Client. Then add them to your Visual Studio project with File->Add Existing Item. You'll get a message that an item with the same name is in source control, click OK. Both the new file and project file will be checked out. Check them back in to save the changes the project file and make the new files part of the solution.
Linda Bauer
SourceGear
Technical Support Manager

rudrvij
Posts: 10
Joined: Wed Apr 12, 2006 1:57 pm

Post by rudrvij » Tue Apr 18, 2006 12:47 pm

Hello,
Thanks for your response.

These are the steps I am following in branching and merging of my application.
1) I add my current solution to the $\Projtects\MyApp\trunk\MyApp and project to $\Projtects\MyApp\trunk\MyApp\MyApp
2) Now I am creating a branch at the soultion level to $\Projects\MyApp\branches\1.0\MyApp
3) As the sln file in the branch is pointing to the trunk's project. I changed the sln file in the branch using VAULT GUI CLinet to point to branche's project.
4) Now I am changing the code in the trunk using VS.Net 2003
5) Now lets say I have a bug in my current prod version (code for that is in my branch). So I am removing all my working folders in my machine. They are pointing to the trunk.
5) Now I open the solution from source control and this time I point it to the branch. Now I added a few files ,deleted and edited a few files to fix my bug.
6) Now I use the Merge Branches option in Vault GUI client. And in the trunk I can see the files added to it. But it did not merge the project file
7) Now I deleted my working folders and open the solution from the source control this time I connected to the trunk.
8 ) As the project files are not merged it did not know what are the new files added and files deleted. (But I can see this info in the Vault GUI client ) I used your method of getting the latest version from repository and then adding them to teh project and Checking them in.

So my question is
1) Are there any pitfalls in my process?
2) Is step 8 common workaround whenevr you do a merge (I can live with it) or is there a smarter approach
3) (This is completely unrelated) Do you have mutiple check out option available in Vault. Does it cause any problems with branching and merging.

Thanks
rudrvij

rudrvij
Posts: 10
Joined: Wed Apr 12, 2006 1:57 pm

Post by rudrvij » Wed Apr 19, 2006 8:57 pm

Any suggestions Valut Techsupport??

Thanks
rudrvij

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Thu Apr 20, 2006 7:26 am

My only suggestion would be that if you want to work on both a trunk and a branch on the same machine, it would be convenient for you to use different working folders for them, so you don't have to switch them around, and you could also work on both at the same time.

It may be that it isn't merging the project file because it is not considered a mergable file, which you can change in the Vault Admin Tool. However, you would need to be careful here because it could change your source control bindings to point to the branch rather than the trunk after the merge, so you'd need to make sure that part of it didn't get merged over.

Yes, you can have multiple people check out files at the same time (for files that are considered mergeable or not binary). You can set this in Tools->Options->General->Always request exclusive locks

Post Reply