index > Team Foundation Server - Version Control > Why is the "Compare" item disabled?

Why is the "Compare" item disabled?


I am trying to get a specific version of a file by label. After I key in the lable and select OK, TFS starts the "flying files" dialog (a.k.a. "coffee time dialog") telling me it is getting a list of files to update.

Eventually I get a "Reslove conflicts" dialog telling me the local file on my machine is writable and I need to resolve the conflict. So I click the "Resolve" button and a "Resolve writable file conflict" dialog appears.

At this point, I only have two options. "Overwrite the local file/folder" and "Ignore conflict".

There is a "Compare" dropdown on the dialog but the dang thing is always disabled. It sure would be nice to be able to compare the file in TFS to the file in my mapped folder before I am forced to overwrite the file on disk. I don't want to just overwrite the file without more information on just what I may be losing. Clicking "ignore conflict" is useless too since it doesn't "get" the file and that means that I cannot even go back to the stating point and choose the "Compare" menu entry that shows up when I right-click on the item in the tree view (it is disabled until I do some kind of "get").

So why is the "Compare" capability disabled on this resolve conflict dialog?

Or: Why can't I just compare the file on disk to that in TFS to start with without having to "get" the file first? And yes I can live with comparing to the latest version. It is better than not being able to compare at all. Really it is.

I am having to resort to copying my file, resolving by overwrite and then doing my own windiff to see what if any issues exist.

R.D.
R.D.,

That sounds like a bug. However, I cannot reproduce it. When I encounter a writable file conflict, I have 3 options:
- checkout and auto merge
- overwrite local file/folder
- ignore conflict

I think you'll find the 1st option most convenient. Also, when I rightclick -> Compare, I'm offered the "Local to Server" choice which works as expected.

Can you provide more info about how to reproduce this?
Richard Berg MSFT

Well, I would paste in an image of the dialog but I can't seem to get it into this view. The "checkout and auto merge" option is disabled along with the "compare" dropdown.

So my only choice is to overwrite since "ignore" means I won't have the file synced to the database. I believe the checkout and auto merge option is not enabled because TFS does not know what to check out. After all, I have to "get" a file before I can check it out. That is, if I look at the TFS "file" pane, the column labeld "Latest" for my items has "Not downloaded" as the text.

It is the same reason the "check out" menu entry is disabled when I right click on an item.

How to repro? I believe part of the problem is that the file on my disk is not a read-only file. If I go to file manager and change the properties to read-only and then do a "get latest", after the flying files dialog runs for a bit, the TFS "Latest" column changes to "Yes" and I do not see the conflicts dialog.

So my guess is that TFS sees the file on disk and sees it is not read-only. So it assumes I have a conflict (when I am pretty sure there is none.) It then presents me with the resolve conflicts dialog without a way to let me comare the file on disk to any version in the database. I normally would want to compare to the latest version in the database. If I have an issue with the comparison, I may want to compare with an earlier version.

R.D.
I figured it out. The problem arises when the writable file has no "have" version, i.e. it exists on disk even though you have never sunc the file into this workspace before. I'd be curious to hear how you got into this situation...

TFS always considers writable files to be conflicts unless you specify /overwrite. It's sort of a poor-man's offline system. Normally when a file is writable it means you've pended a change on it (e.g. Checkout); if we come across a file that's writable but has no pending change in the database, it usually means someone needed to edit the file while they were offline, so the default resolution is "checkout and auto merge" which brings the workspace & the database back in sync.

In your case, since there is no record of which version you have in your workspace, we can't do a checkout. However, we should still give you a chance to diff & merge against the server version. I'll file a suggestion.
Richard Berg MSFT
I should point out that there is a way to compare against latest. Cancel out of the Resolve dialog, then run tf diff file file;T
Richard Berg MSFT
reply 5

You can use google to search for other answers

 

More Articles

Coexistence of VSS and TFS
Check out files status
Problem with MSSCCI Provider
How do i setup web development?
Merge Conflict - All options diabled
What is the responsibility of tbl_WorkspaceLink??
Getting latest versions for non-labeled elements in Get by Label ...
Checking in Enterprise Library
View History Errors
UI Bug
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Getting latest versions for non-labeled …
Folder compare
Architectural Question ??TFS API
Find deleted Items / Search for checked …
Error: Can't Load Checkin Policies from …
Any experience using cs-converter?
Visual studio locking up when doing TFS …
Check In to Branch But Ends up in Trunk
Source Control Reporting
Access Denied to file when Get Latest Ve…
whitepaper, docs about version control
Changeset Rollback Problem ..
Searching Team Foundation source control
Trouble using both VSS and VSTS
Check-in and get latest for other users

Hot Articles

Project deletion and Branches
Merge to Sibling Branch
Team Foundation Version Control Command …
Database error SQL error 2627 on tf mer…
Mapping a new Team Project to a non-root…
Readd of a project which was bind to sou…
Preserve timestamp on files when getting…
Version Treeview
Enable Code Analysis make me miserable
Branching Strategy Validation
Delete label by Id, TFS API
VSS Migration Error
Merging Visual Studio solution/project f…
Import CheckinNote definition?
Single source file branch and compilation

Recommend Articles

Zero-byte Files After Performing "G…
Version Control Setup
branching files twice to the same branch
Database Size limits
managing source control folders through …
Branching from a labeled version after a…
CodePlex and Source Control Issue
Visual Studio "Check In" ticks…
Items cannot be placed under source cont…
Mapping a local folder to more than one …
Corruption in Source control
Team Projects Check-in Policy for manage…
What can we do to resolve workspace mapp…
TF30063: You are not authorized to acces…
Can I modify behaviour of get operation …