Team Foundation Move File Deletes Labels but Keeps Changeset History - visual-studio-2010

I have moved some source files from within the TFS GUI from:
$Product\AppName1\File
to:
$Product\AppName Common\File
The history of the changeset has been preserved but not the labels - can anyone help?
The strange (and annoying) part of this is that the label history is show after the move but when I commit the move (which is actually a rename in TFS terms) then the label info is gone

You used the "Move" command in Source Control Explorer? It creates a new changeset. Surely the label still contains the original versions, before the move?

Related

Visual Studio 2017 - moved local TFS workspace folders - best/correct process to re-connect?

Had to move my directories for the local workspaces for Visual Studio. I updated the directory locations in VS, but it acted as if they were completely out of sync, and asked to get latest.
I let it do so for one project - it (re)downloaded everything, came up with a list of files to which I had local changes, listing them as conflicts. I kept the local version of all the files, so no work was lost. But when I opened the project, those files came up as not being in source control, and it offered to let me add them. So again, I have all my work, but that's a tedious process to re-connect everything. Not to mention that I'm not sure I caught ALL the files that needed re-adding.
I've also considered copying everything to other directories, download a clean copy of the project(s), doing a compare and folding in my changes. Still messy, but possibly safer.
Is there a far better way to do this practice that I've missed? Perhaps as a side question, is there an easy way to list all the files in a project not in source control?
Guess you moved/changed local TFS workspace folders in file system directly. This caused some folders/sub-folders/files lost mapping.
In other words, all of these folders already out of source control. That's why you need to re-add or re-connect them to TFS source control.
A right way please refer how to move an item in TFVC:
You can use Source Control Explorer to move one file or folder at a
time. You should not use Source Control Explorer to move folders or
files that are referenced by a Visual Studio project or solution. Move
these files with Solution Explorer instead and check in the move in a
new changeset.
In Source Control Explorer, select the item that you want to move,
open its shortcut menu, and choose Move.
In the Move dialog box, either manually type the destination for the
item in the To box, or choose Browse to use the Browse for Folder
dialog box.
Choose OK.
Move is actually a delete and re-add process. You could also take a look at this similar question here: Moving project (under source control) to different folder
In your situation, a quick way to solve the conflicts should be: First back up your local files, delete your old workspace, create a totally new workspace. Get latest version from sever side to your new workspace.
Then copy your back-up files/folders which copied from old workspace folder to the new one. Windows system will judge to replace files and add new files.(It may take some time) After this, TFS system will auto detect the changes in local and will list them as new pending changes. Some new add files maybe stay in the Excluded list, manually promote them in Included list.
Finally check in all your pending changes, everything should get back on track.

Why does TFS show pending changes for all my files when I haven't changed anything?

I am new to using TFS source control.
I have a large project which I have been porting from SVN. I am checked in and up to date with all projects. However, I opened up Visual Studio today and all project items are in the pending changes included window even though there are no changes.
I haven't touched or edited any of the files for my TFS files since last time.
To verify, I used Araxis Merge to do a folder comparison and can see that no actual changes have taken place.
Why are these unchanged files appearing in my check-in window?
Here is an example of a diff in visual studio from the previous version:
I can't see anything!
Hopefully this shows my local workspace
When you create or edit a workspace, you can specify whether its location is Local or Server. Local Workspaces are TFS's attempt at DVCS and actually gives you a much more SVN-Like experience.
Edit the workspace and choose advanced, you could see the Location of workspace type.
Maybe formatting, line endings, encoding. Do a diff using Beyond Compare or something to see what changed.
If nothing changed, check if you are using the same workspace. You may select another workspace than you used.
In Source Control Explorer, check if you choosed the workspace the workspace you were work in.
If all above not work, you could also try this workaround, select all the files in "Pending changes" window and activate the context menu. Then click "Undo..." > "Undo Changes" > "No to All".
The files without changes will be rolled back. More details please take a look at this question: how to undo pending changes of files that are unchanged?

How to reset source control for messy project?

I recently refactored an old project and altered its file/folder structure, which has caused big problems checking in. I can't check-in pending changes because parent folders have pending changes along with their children. I've tried checking in groups of changes at a time but to no avail.
Is there a way to reset the source control without erasing my TFS work items and change history?
if everything is as you want it in TFS, you can delete Your local workspace, to clear any files you have locally.
You can then goto to Advanced>Source Control and choose specific Version.
tick both boxes and click ok
when refactoring folder structures within TFS you are best to use the move function of TFS, (shown in first Pic). Move your folders, this way TFS will retain history, then open the solution and remap any projects that have moved

How can I see the change log of a directory with TFS?

I'm interested in seeing the latest changes that landed to a solution with TFS (I'm using Visual Studio). However, I can't seem to find the option: using View History on a solution or project brings up the history of the file itself. Am I missing something?
If you right click on folder the containing a solution in the Source Control Explorer window you'll see all changesets. It's obvious but I had to ask for it too. I am using TFS2010/VS2010.
Edit
Here are the steps:
Team/Connect to Team Foundation Server / select Team Project/ in Team Explorer dblclick on Source Control and in Source Control Explore right click folder containing your solution select View History and here you are.
The View History command will list you all the changesets where the file/directory was changed (add/move/content changed, deleted, etc.).
So if you do a View History on a .sln or .csproj file you'll see only the changes that were made inside the file's content, not on the "Visual Studio Item" and its related item.
To sum up, the View History command is only a File System history, there's not a smarter logic out there.
EDIT
The only way to know what changed inside a solution or project is to do a View History on the common denominator (i.e. the directory that contains everything you want to view history). But it'll still be a File System kind of History.
There's not Logical History for Solution and Projects in Visual Studio. For instance you can't know what files where added to a given project your viewing the history from two given versions. Or what projects were added/removed in the solution.
All the pieces are there (because all the changes are stored in the .csproj or .sln), but the feature itself that parses the content and retrieve the logic you want to see doesn't exist. (by the way, it's a great feature and I agree it should be there).
Bottom line: TFS/Visual Studio gives you two history system:
Based on the source control/file system, by displaying changesets.
Based on the source control/file system, by displaying labels.
That's all...
Right click on folder in solution explorer, and choose View History. Then you can see all the Changesets listed that apply to that directory. Then right click a particular changeset and choose Changeset details... to see what changes occurred in that changeset.

Borland Starteam: How to re -check-in a file from a frozen labeled configuration to current configuration with history

Borland Starteam: How to re -check-in a file from a frozen labeled configuration to current configuration with history?
You should be able to go to that frozen labeled configuration (View->Select Configuration->Labeled Configuration) and pick that label. Then what you are seeing should be files as of that label. You could then checkout the file you wanted from that label.
Then go back to the current configuration (View->Select Configuration->Current Configuration) and check-in your file (you will have to do a Forced Check-In since it will show as Out of Date status). In the check-in comments you may want to mention that you pulled that file forwards from that label.
You will not lose any of the history between the label and your check-in.
If the file does not exist in the current configuration, you can share the file from the labeled config to current - just have the view open in two separate windows. This will retain all of the version history.
There is a hiccup in that it will not allow you to share the file into the same folder as it originally existed (as of 2008R2). Just share the file into a different folder then move it.
All history is retained. Note that the new instance is a share, so you may want to check the reference tab before branching to make sure it will do what you expect.
Based on GanYo's comment to the question -
The problem is not the fact that the file is sitting in a frozen label -
the real problem is that the file was deleted.
You cannot "bring back to life" a file that was deleted,
but you can "go back in time" to see it's history (as mentioned by Dougman).
The only solution supported by Borland is this:
Set-Configuration to a time (or label) just before the file was deleted
(this should allow you access to the latest version of the file with all its history).
Check-out all the different revisions of the file, one-by-one, keeping them in unique names
until you have the complete list of revisions.
(best is to append the revision-number to the name of each revision to the file being saved locally)
Set-Configuration back to 'Current'.
Check-in the complete history of the file, starting with the oldest version of the file,
and going forward, until you have imported all the file-revisions in the correct sequence.
(you have to rename each revision of the file to its original name before you check it in, of course)
Having said that, you really need to think if this is worth it, because:
This "restore" process does not bring back:
the comments of each revision
the CR-links that were attached to each revision
the Lables that were attached to each revision
The file's history was there all along, and is available via 'Set Configuration' - why duplicate it?
Bottom line:
It is probably best just to restore the latest version of the file,
mentioning in the comment that it was deleted accidentally and that its history can be reviewed
by doing 'Set Configuration' to ...

Resources