WXS123

We have a case that our tree looks like

$/TeamProject/Trunk/SpecialDir

$/TeamProject/Trunk/Dir1

$/TeamProject/Trunk/Dir2

...

We have branches at

$/TeamProject/Branches/Branch1/SpecialDir

$/TeamProject/Branches/Branch1/Dir1

$/TeamProject/Branches/Branch1/Dir2

...

Normally the merge is done from Trunk to Branch from $/TeamProject/Trunk for example.

Is there a way so when merging is done we can exclude the SpecialDir from being merged by default

The issue is our special dir in this case is our installation script directory and it does not always make sense to merge that. Developers do most of the merging, we don't want them to accidentally merge the install script though which is done by another team. (This happened once already and caused an issue).

The only other alternative is to move the source down one level and keep our installation (SpecialDir) seperate.

One idea.. if developers were excluded from certain permissions on the SpecialDir would it still try and do the merging for them or would it not merge depending on permissions.

Ideas



Re: Team Foundation Server - Version Control Excluding directories from merging?

Richard Berg MSFT

Permissions: for a merge to work, you need Read permission on the source and Checkout permission on the target. Seems hard to come up with a permission scheme that prevents merges in both directions without cutting off access.

One way is to create a label that only contains Dir1-DirN, then merging with a versionspec of Llabel~C12345. Note that this limits you to catch-up merges. If you wanted to do a cherry-pick merge you'd first have to update the label so it points to the exact versionFrom you want.

I think moving the source down one level is the easiest solution. So you'd have
$/TeamProject/Trunk/install
$/TeamProject/Trunk/src/Dir1
$/TeamProject/Trunk/src/Dir2
....

Devs would know it was safe to merge the "src" tree.





Re: Team Foundation Server - Version Control Excluding directories from merging?

WXS123

Richard Berg MSFT wrote:
Permissions: for a merge to work, you need Read permission on the source and Checkout permission on the target. Seems hard to come up with a permission scheme that prevents merges in both directions without cutting off access.

One way is to create a label that only contains Dir1-DirN, then merging with a versionspec of Llabel~C12345. Note that this limits you to catch-up merges. If you wanted to do a cherry-pick merge you'd first have to update the label so it points to the exact versionFrom you want.

I think moving the source down one level is the easiest solution. So you'd have
$/TeamProject/Trunk/install
$/TeamProject/Trunk/src/Dir1
$/TeamProject/Trunk/src/Dir2
....

Devs would know it was safe to merge the "src" tree.

Thanks.

One possibility would be to make merge permission different (additional) to checkout/checkin but that opens up some ugly possibilities of merging and thinking you are merging everything when you are not. If maybe it indicated folders/files were skipped perhaps that would help if this option were chosen though.

Here is an interesting possibility... authorize access by work item (doesn't help us because we don't use work items yet.)

Then require only authorized work items for a particular branch.

This would allow patches to ensure only related code can be modified for a branch.





Re: Team Foundation Server - Version Control Excluding directories from merging?

Richard Berg MSFT

Giving errors for files w/o permission is no problem. We do that already for all failed permissions except Read. When Read fails, we pretend it doesn't exist.

We'd need to treat merge permissions differently before doing any Work Item integration. During normal (non-merge) checkins, there is no WI associated with the code until the checkin is complete. Only during Merge do you have WIs associated already (with the code in the source branch). It's an interesting idea.