tags:

views:

97

answers:

2

I am trying to understand the history of my codebase, which resides in TFS 2005, and I encountered a changeset where all changes were marked as both branch and merge.

Name    Change           Folder
------------------------------------------------
A.cs    merge, branch    $/Root/Solution/Project  

I am unable to find anything (especially on MSDN) describing what the various combinations of Add, Edit, Delete, Branch, Merge, Undelete, Encoding, etc mean. Each is pretty self explanatory when used alone and some do not make sense together like Add and Delete so I am looking for information on the legal combinations and what they mean.

A: 

This might make sense if the file were created during a branch operation and changes from the source branch were then merged into the new branch without having checked in at any point.

Scott Munro
I tried this and Visual Studio prohibits merging into an uncommited branch.
Faron
+2  A: 

Merge can be combined with anything except Add. On its own, Merge just means that (1) whatever happened is the result of invoking the Merge command (2) when you checkin, TFS will record the appropriate merge history metadata in addition to the changes themselves. The remaining operation(s) in the list of changetypes tells you exactly what kind of change is being applied to the target item. Thus:

Merge, Branch = an item that exists in the source branch but not the target branch is being copied over to the target for the first time

Richard Berg
So (merge):no real change, (merge,branch):copy file from source to target, (merge,delete): delete file from target, (merge,edit):update file in target with contents from source, (merge,rename):rename file in target, (merge,undelete):undelete file in target, (merge,rename,edit):rename file in target and update its contents
Faron
Yup, pretty much. Fwiw, there are some funky combinations that are only possible during Merge. If source item doesn't exist in target, but you decide to discard the candidate changeset [or equivalently, delete the item while it's in pending merge+branch state], you end up with (merge,branch,delete). Or if an item foo is deleted in both source you undelete source\foo, then later delete source\foo\somechild, then merge all of the above; the result of the merge will place target\foo\somechild in a (merge,undelete,delete) state.
Richard Berg
Do you know where this may be documented?
Faron
I don't think it is, officially. Closest thing would be the ChangeType enumeration in the client API.
Richard Berg