1

EVERY SINGLE TIME I unshelve a changeset with add/rename/move/remove changes or have pending changes with such changes, I have to manually merge the parent project file which receives a lot of activity (the majority of the codebase is nested under the one project so its project file's version changes very frequently).

This is a multiple-times-per day frustration and it seems that TFS should be able to do this for me since the changes are simple (e.g. remove the line for the deleted file in latest version and add the line for the new file in local version). I conclude this because it behaves intelligently in this way for code files to automerge versions.

So why does automerge behave differently with project files than with code files?

For example, developer A creates a changeset adding a file to the project and shelves it for review. Then another developer B checks-in changes to the project that also adds a file (unrelated), so when I go to unshelve developer A's changes I have to resolve conflicts on the project file.

Also, if a group of files are moved/renamed/added and I want to unshelve with only a single affecting change, it is much easier to just take the server version of the project file and manually reapply the single change (e.g. add existing file) instead of merging a dozen spread out changes across thousands of lines. (And god forbid you have a rename change and took server version of the project file, because then you need to manually edit it with a text editor to rename otherwise you'll get a sequence of errors due to the renamed file already existing on disk when trying to rename from solution explorer).

Update: I'm escalating this, because now it's screwing us over.

Using VS2014 and our codebase mostly lives under one giant database project (*.sqlproj).

1 Answer 1

0

Most likely, different files get added on the same line in the file since in most cases, project files are auto-generated, unlike regular code, it is hard to tell in which line VS would insert a new file item when someone adds it on the front end. If 2 people add new items to the project at the same time, it is very likely that you will get 2 versions of the project file with these new items written on the same line, which will cause the conflict. Sometimes, (e.g. if you add reference), it's more than one line per item, which makes merging even worse. I would suggest that each developer that makes changes to the project file, checks it out with the lock (exclusively), so there will be one change at a time. Also, make sure other developers get latest before making their change (there is a setting in Visual Studio under Tools > Options > Source Control > Visual Studio Team Foundation Server). This will make auto-merge work.

5
  • Most people use Git as their source control store in TFS. Exclusive checkout in Git is dicey (and by dicey, I mean nonexistent). Mar 1, 2018 at 21:05
  • True, but I think the fundamental problem is still going to exist (2 lines with same number and different content will cause merge conflict), so if exclusive checkouts are not possible, other suggestions would be 1) split the project; 2) coordinate changes to the project file
    – Eugene B.
    Mar 1, 2018 at 21:15
  • Exclusive checking out is probably not an option because of the volume of development that occurs in the location, and we get latest version frequently. We make extensive use of the shelveset functionality in TFS as part of our development process for code promotion, so often times it is multiple days later that a reviewer pulls the code to check. Mar 1, 2018 at 21:59
  • Generally resolve conflicts is against the files which already in source control. So the recommend action is that getting latest before making their changes, during the get action you may need to resolve the conflicts manually first, that's the expected behaviour. See Resolve Team Foundation Version Control conflicts. Mar 5, 2018 at 9:29
  • @AndyLi-MSFT Our process is to get latest version, make changes, shelve changes, test and review changes, apply changes. After shelving changes, days can go by so the affected project files become desynced from latest yet again. Why is it so onerous to re-sync those project files for the common development use case of someone adding a new file? I now have 4 target branches that all require merging conflicts on a gigantic project file that takes numerous minutes to reload. May 3, 2018 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.