What is the difference between [merge] and [merge,edit] in visual studio 2013 - visual-studio-2013

I have source code in the main. From this main i created a branche development. After changing the development branche i want to merge these changes back to the main. When i do this these changes are marked with [Merge,Edit] while i expect [Merge]. Can anyone explain this behavior?

(merge) means merge with no real change
(merge,edit) means merge with a change on the file in target with contents from source.
Nice readings on: What does it mean when Source Control Explorer shows both branch and merge for a changeset?
Unfortunately no msdn pages...

The merge status means that the revision contains a merge from another branch.
If a particular file is diffrent in the two branches, the file will have the status "merge, edit" because it is both merged from the branch and changed content.
After you perform your merge and check in it, a Conflicts Window appears.You must solve the confics of the file which has "merge,edit" status before check in.

Related

Restrict to commit file in checked-out state in TFS

I have two branches say dev and rel. If I am changing file 'A' under dev and without commiting I will mergr to rel, I am getting change status as "[merge]". And If change the file, commit it in dev and then merge to rel status will be "[merge,edit]".
Is there is any option in VS 2013 where it should not allow to merge the file for developers if it is in checked-out state.
Scenario:
One file already committed to the server with change and second file is in checked out mode and not checked-in to the server.
So first file merged separately which got merged and then after changing the second file, added first and second file in single change set with checked out mode of second file. So no conflicts while merging because second file code was in checked out mode..
How to go ahead where - Developer cannot merge if file is in edit mode.. it should allow only when changes are checked in to server.
No this isn't possible. The ability to edit files during merge is required in order to be able to perform conflict resolution.
In TFS, merge specifically means that its this revision contains the merge from a another branch. however,merge only represent the merge operation. So it shows [merge] status for the unchanged file and shows [merge,edit] status for the files that actually changed and shows [merge branch] for the new add item.
It's not possible to restrict users to do the merge files when the files be checked out. This is used to resolve the conflicts.
We do not have this kind of build-in feature for local workspace. If you are using server workspace, you could try to sue Check-out lock for target branch, a check-out lock prevents users who are using server workspaces from checking out and making changes to the locked item in their workspaces. You cannot apply a check-out lock to an item for which any pending changes exist, in any workspace other than your own. More details take a look at this link.

Is there a way of displaying a full list of errors when checking in pending changes?

I'm currently going through checking in changes I have made to my code. There are well over 100 files which have been changed, and I am repetitively getting this error for various files.
Could not find file '[File Path]'.
While I can understand the reasoning for the error, and I know on how I can fix it, how would I display all files which are throwing this type of error when checking in? Consider it to resolving merge conflicts, you would be given a list of files which require attention, you can easily see multiple and deal with them. Unfortunately while checking in changes, it only displays on error at a time.
The current process I am going through is Check In > Error Thrown > Fix Error and repeat. It would be so much more faster to be able to see all affected files and deal with them unlike the way I am currently doing.
I am using TFS 2015 on Visual Studio 2017 Enterprise.
Thanks in advance.
There isn't a good solution (at least not one I'm aware of) to the problem you are facing. Typically in these situations, I recommend to people to backup your changes to another folder and undo your changes in your working copy. From there copy back in the files you care about and if you renamed or delete files, make sure you do it through Visual Studio in either the solution explorer (provided your solution is correctly connected to version control) or in the source control explorer.
Another option is to try and reconcile the changes in source control explorer. You can use the tf command line tool to get a list of pending changes. Running tf status at the root of your workspace will give you a list of pending changes. You can then compare the output with what you have locally in the file explorer. Any files that need to be renamed or deleted should be done in the source control explorer.
As a side note, when using TFVC you should always do all of your rename and deletes through source control explorer to avoid this issue. Also, try to limit the number of changes you make between commits. Having over 100 files changed in one commit will quickly get you into a situation like you are in. Smaller, incremental commits are always preferred over large sweeping changes.

Team Foundation Server error

I have done some work on a VS 2010 project which is under TFS. I have created a shleveset and want to unshelve the shelveset on another system. But I am getting following error:
---------------------------
Microsoft Visual Studio
---------------------------
Multiple errors occurred during the operation, the first of which is displayed below. A full error list is available in the Output Window.
TF203015: The item $/ConsumerCredit/project1/project1.Database/project1.Database.dbproj has an incompatible pending change.
---------------------------
OK
How can I fix it
Some guesses:
Look at your list of pending changes. You may already have opened this file for delete or rename or something like that. You can't get the file out of the shelveset because you opened it in the shelveset for something different such as for 'edit'.
You'll probably have to undo your pending change on this file and then get the shelveset.
Or possibly you locked the file when you checked it out on one system, so you can't start editing on the other system (getting it out of the shelveset would adding to your pending files for edit). You could undo the checkout of the file on your first system.
This is a slight aside to the OP's question
You can get a TF203015 when you try and batch merge a multiple changesets from one branch to the other without due care.
Consider a situation where you have a MAIN trunk and a DEV branch. You branched DEV from MAIN and have dillegently worked away at a feature in DEV; checking work back into DEV as you progressed. Now fast forward a week or two. You are now feature complete and want to merge back into MAIN.
This is where one of our devs hit this error.
He had been woking on one solution for weeks, and checking changesets back into DEV periodically, so wanted to merge a non contiguous series of changesets back into MAIN.
So he picks the merge option, selects the first changeset; merges withoout issue, then immediatley went to merge the next changeset; and bang TF203015, and its very unhelpfull test in teh output window; incompatible pending changes.
After a little fiddling around we now realise what is going on here; the first merge created a pending change in MAIN for the developers solution. The next merge attempt was also changes to the same solution, which would require TFS to "queue up" a second set of pending changes to the same files. It cant do this.
So in this scenario TF203015 means; "The destination branch already has pending changes on some files that are changed in this changeset. Please resolve and commit the destination branch changes before perfoming this merge operation"
The solution; after each merge operation our developer tests the workspace for MAIN and commits the pending change caused by the merge, then goes back to DEV and repeats.
Actually sensible and simple, but masked by a very obtuse error message.

How to Merge Select TFS Changesets into My Workspace without All Previous Changesets Included

I am working on a project with another developer. We are in the process of a major upgrade with lots of breaking changes. The software we are working on is an AddOn to a product, and we are upgrading to work with a new version of the product. He has checked in some breaking changes that will not run in my environment yet because I am still running on the old version of the product. I have checked in some changes on top of those. Is there any way I can retrieve the code such that it includes only the changes up to the point before the breaking changes and also include only my changes after that in my workspace?
If I had not done a "get latest" I would be OK now because I made the changes on my machine so I would have them. But now I need to "get specific version" to take me back before all the breaking changes and somehow merge only my changesets into my workspace. But there seems to be no way to merge changesets into a workspace, only into another tree. I could select only the files that I touched and get the latest versions of those files, but some of the files contain changes from both my changesets and his changesets (and mine are after his).
So what I really want is a way to merge specific changesets into my workspace (without pciking up all the previous changes) to get back to the state I was in before I did "Get Latest". Is there any way to do that?
Looks like there's no good way to do this. Fortunately, I had another branch that represented the changes I wanted (I had only merged my changes I wanted into it). It didn't feel right to just copy the whole tree over my working tree, so I used WinMerge to identify the files that were different and copied just those files over (after a cursory look to confirm that it was a file that included my changes -- there were a few files generated by Visual Studio that were different just because they were in a different path).
So I guess the general solution would be to create a branch in TFS, merge everything you want into it, get a local copy, then copy the results into your workspace. That does leave a mess in TFS, though (how do you completely remove the dummy branch?) Fortunately the branch I had was one we really wanted to keep (we have a build branch separate from teh development branch).
I'm not really sure if this answers your question, but if you select "Get Specific Version..." then you can select a specific changeset.

TF203015 The Item $/path/file has an incompatible pending change. While trying to unshelve

I'm using Visual Studio 2010 Pro against Team Server 2010 and I had my project opened (apparently) as a solution from the repo, but I should've opened it as "web site". I found this out during compile, so I went to shelve my new changes and deleted the project from my local disk, then opened the project again from source (this time as web site) and now I can't unshelve my files.
Is there any way to work around this? Did I blow something up? Do I need to do maintenance at the server?
I found this question on SO #2332685 but I don't know what cache files he's talking about (I'm on XP :\ )
EDIT: Found this link after posting the question, sorry for the delay in researching, still didn't fix my problem
Of course I can't find an error code for TF203015 anywhere, so no resolution either (hence my inclusion of the number in the title, yeah?)
EDIT:
I should probably mention that these files were never checked in in the first place. Does that matter? Can you shelve an unchecked item? Is that what I did wrong?
EDIT:
WHAP - FOUND IT!!! Use "Undo" on the items that don't exist because they show up in pending changes as checkins.
I had deleted the files in trying to reload the workspace, even though I had shelved the changes. Then VS2010 thought those files were still pending to save. I didn't need that, so I had to figure out to "undo" the changes in Pending Changes.
Then I could unshelve.
It thought I had two ops (unshelve, commit-for-add) going simultaneously, and I thought I had only one op (unshelve).
This is a slight aside to the OP's question
You can get a TF203015 when you try and batch merge a multiple changesets from one branch to the other without due care.
Consider a situation where you have a MAIN trunk and a DEV branch. You branched DEV from MAIN and have diligently worked away at a feature in DEV; checking work back into DEV as you progressed. Now fast forward a week or two. You are now feature complete and want to merge back into MAIN.
This is where one of our devs hit this error.
He had been working on one solution for weeks, and checking changesets back into DEV periodically, so wanted to merge a non contiguous series of changesets back into MAIN.
So he picks the merge option, selects the first changeset; merges without issue, then immediately went to merge the next changeset; and bang TF203015, and its very unhelpful test in the output window; incompatible pending changes.
After a little fiddling around we now realize what is going on here; the first merge created a pending change in MAIN for the developers solution. The next merge attempt was also changes to the same solution, which would require TFS to "queue up" a second set of pending changes to the same files. It cant do this.
So in this scenario TF203015 means; "The destination branch already has pending changes on some files that are changed in this changeset. Please resolve and commit the destination branch changes before performing this merge operation"
The solution; after each merge operation our developer tests the workspace for MAIN and commits the pending change caused by the merge, then goes back to DEV and repeats.
Actually sensible and simple, but masked by a very obtuse error message.
You can use the Team Foundation Server Power Tools March 2011 (http://msdn.microsoft.com/en-us/vstudio/bb980963.aspx) that includes the command tfpt unshelve.
Once the Power Tools are installed, open a Visual Studio command prompt, change to the directory that contains the project of interest, and execute the tfpt unshelve command. It will unshelve and display the merge dialog so you can resolve the conflicts.
I credit this blog post with helping me find this solution: http://fluentbytes.com/the-how-and-why-behind-tf203015-file-has-an-incompatible-change-while-unshelving-a-shelve-set
I had what appeared to be the same issue but I had created a branch after shelving my changes and I wanted to unshelve those changes to the new branch.
TFS cannot unshelve to a different path than the path upon which the shelf was created.
Solution: I unshelved back to the original branch then I used beyond compare to merge the changes from my original branch to the new branch and checked in.
It could also be that after you create a folder in say a "Test" and you want to merge from dev to test, that you do not have that newly created folder structure checked into TFS - You will /can also get this error message.
Thus this message error CAN occur without anything to do with SHELVESETS as well for others coming from google and finding this page.
This might be the same as jcolebrand's answer, but I'm afraid I found the phrasing there a bit abstruse. Sincere apologies if I'm just repeating.
In my scenario the incompatible pending change message was presented because I was trying to roll back multiple changesets, and the same file was affected by more than one of those changeset.
In my case I did not want to commit until all the changes had been rolled back. I believe if I had been able to commit after rolling back each changeset, the error would not have happened.
The method which worked for me was as follows:
I opted to roll back one changeset at a time. I found using the command line was actually a more informative way of doing this because it lists all the conflicts, whereas I think the VS UI rollback just lists the first.
While rolling back a changeset, if there was an incompatible pending change, I had to undo my workspace's pending changes for the affected files.
When all the changesets had been rolled back, I had to manually revert the files which had experienced incompatible pending change. Mostly this could be achieved simply by getting a specific version of the file (the "last-known-good" version before all the bad checkins started). But for some files where there had been both desired changes and undesired changes, I got the "last-known-good" and manually applied the good changes to it.
This link resolved my issue:
https://blogs.infosupport.com/the-how-and-why-behind-tf203015-lt-file-gt-has-an-incompatible-change-while-unshelving-a-shelve-set/
The reason was pending change in the same work space create an incompatible change. So undo the pending changes and try unshelve. This should resolve the issue.
If you have two branches MAIN(target) and DEV(source), now you want merge DEV into MAIN, then all files you want merge from your source, must not be older then the similar files in your target branch.
For example: you have an changed file test.cs in your DEV branch, changed at 14.03.2016. In your MAIN branch you have test.cs changed at 15.03.2016. So the target is newer then the source file and you have TF203015.
Solution: navigate in TFS Explorer to the conflict-file and merge it explicit. TFS will open the conflict manager and you can merge the conflicts by hand. Following you can merge the selected changeset.
Remarks: If you have more conflicts, you must navigate to each conflict-file and merge it explicit, so TFS opens the the conflict Manager and you can merge it by hand.

Resources