FileName Collision Conflict that won't resolve through the UI- Part 1 of 2

I recently had to work with a customer to get them past a problem they encountered after performing a merge operation. The interesting part is that the issue was not necessarily in merge but rather when attempting to check-in; which shed some light on how good we need to be end-to-end sfor the customer to get the best experience with the product.

 

Note: On this blog post I am assuming that you are familiar with merge, resolve and some of our Version Control concepts so I will not go into detail about each of them.

 

The scenario is as follow:

1. Developer establishes a branch relationship between source and target (tf branch source target)

2. Normal development continues to happen and files get added and merged between these two trees

3. Developer deletes a file in source (a.txt)

4. Developer adds a file in source with that same name (a.txt) at a later time

5. Developer merges these files using the UI (you can also use the command line- tf merge source target /recursive)

6. Merge computes and for the file that was deleted and re-added a merge, branch is generated (this is expected)

7. Developer goes and checks in

8. Developer gets a conflict

9. Developer tries to resolve the FileName Collision conflict

 

And here is where he hit the problem. The only two options you can select from the resolve dialog are: Undo or Ignore. Guess what, none of them get you closer to actually resolving the conflict so now you are stuck (and yes maybe a bit mad at me and Microsoft).

 

How can you resolve this conflict you might ask? Well, the first thing is to undo those pending changes and really think about what you are trying to accomplish. I divide this into two main buckets:

a) The file was added by mistake and the developer should have really undeleted the file and then check-in a new copy. I need to establish the relationship again

b) The new a.txt is really another file and I need the target a.txt to take a new name

 

As you might expect each has a different resolution and cause so I will focus today on A: Establishing the relationship again and merging the contents.

To perform the baseless merge execute the following command from the command line:

 tf merge /baseless source/a.txt target/a.txt [/version:ChangesetNumber if wanted] /recursive

 

This will generate a conflict which you can resolve by running:

tf resolve /auto:AcceptYours (if you just want to keep what the target currently has because they are already in sync)

tf resolve /auto:AcceptTheirs (if you want to force the contents of source into the target)

                tf resolve (if you want to start the GUi and merge the changes manually)

 After the resolution is recorded you can check in and everything should be back to normal.

 

Hopefully this has helped you and over the coming days I will post a similar kind of step by step solution for the remaining two scenarios.

  

End quote: "One more to go"