Team Explorer Everywhere - Remove Ignored files from Pending Changes - eclipse

Is there any way to remove pending changes from the Pending Changes list in Team Explorer Everywhere for TFS?
I've added a .tpignore file to my project, and I'm excluding certain things that I don't want in source control (build, WEB-INF, etc). However, it looks like team explorer everywhere picked up on these files before the ignore file was added, since they remain in the pending changes list.
I can see that eclipse is at least picking up that they should be ignored, because they all have the [Ignored] label in the project tree. I would have thought that adding files to the ignore file would automatically remove any pending changes that existed for the files....
Any idea how I can remove these items from the pending changes? I can't checkin until this is resolved because I don't want to mess up my source history with all of these extraneous files.

That's correct - Team Explorer Everywhere applies the .tpignore filter when it detects that the files were added to your Eclipse workspace. If you edited the .tpignore file after they were detected then they will remain pended - ignoring resources is not done retroactively.
You'll have to undo these pending changes manually, by right clicking on the resource in an editor or a view and selecting Undo Pending Changes. If you have whole folders full of files to undo, you can select a folder in the Package Explorer and undo pending changes for that folder recursively.

The Pending Changes window lets you select multiple files and undo them all at once. This seems to be the easiest way to undo the damage.

Or, simply within your Team Explorer Window...
Choose 'Home'.
Re-choose Pending Changes
To recalc what should be considered 'Pending changes'

Related

Eclipse Team Synchronizing View: How to remove unversioned items in outgoing changes?

While viewing the outgoing changes in Eclipse Team Synchronization(Subclipse), I am able to see the unversioned files also, like the generated class files, build folders, etc, which I do not want to see in this view. I dont want to add it to svn:ignore, since I have to do it manually for all the additional folders generated.
Is there any setting to change this to show only versioned files in this mode always?
Tortoise SVN client shows this option while committing, to show only versioned files. I am looking for such an option in Subclipse Team Synchronization view. Thanks in advance.
eclipse_outgoing_view
You should svn:ignore build folders.
Otherwise it's only a question of time until you or your colleague checks in the build folder
You should use svn:ignore, and note that once you do for a folder, all child folders are automatically ignored. In your example, if the build folder were ignored then everything inside it would automatically be ignored. It looks like your build folder has already been added to repository though, so maybe you can ignore the dist folder inside bin.

How to checkout from diff view?

I am using Perforce 2015 client (P4V) on Windows 7.
I changed some files in my IDE. Then I use "Folder Diff" in Perforce to locate them. I was expecting to find "checkout" right click menu on the "Folder Diff" Perforce window in order to move my changes to a changeset but I don't see any "checkout" around.
How can I checkout directly from Diff view?
If you changed files on your workstation, but Perforce doesn't know about those changes yet, the command you're looking for is "reconcile".
I believe that P4V's Folder Diff may only show you the reconcile options if you use Folder Diff from the Advanced Reconcile Options variant of Reconcile Offline Work.
So to perform this style of Folder Diff within P4V, you should start by context-clicking on the root folder in your tree view and choosing "Reconcile Offline Work", then choose the Advanced Reconcile button at the bottom of that display, as described here: http://www.perforce.com/perforce/doc.current/manuals/p4v/Offline.html
Then, when Advanced Reconcile opens up the Folder Diff, you will see suggestions in red lettering about what your options are for each file (Mark For Edit, Get Revision, ec.). You can then pick one of those options by context-clicking that file in Folder Diff.
Alternatively (and perhaps more useful, once you get used to it), you can do this from the command line. If you haven't worked directly with the command line before, you can context-click "Open Command Window Here" on the root folder of your workspace treeview to get to the command window. Then, type
p4 status
to see a report about what changes you have made to your files, and
p4 reconcile
to make those files open for add, edit, or delete, as appropriate. Then close the command window and refresh P4V to see them.
I am not sure what your exact scenario and IDE is. I am using Visual Studio with the Perforce plugin, and when I make any changes in my source this plugin will check-out this file automatically (you can also choose to be prompted). So no need for folder diffs to locate any changes.
Should your IDE miss any integration plugin's then a very simple workflow could be like this:
Go to Perforce and check out all the files in your solution
Make your edits in your IDE (online or offline doesn't really matter)
In Perforce choose 'Revert Unchanged Files' on the changelist
And voila, only the changed files will be left in your changelist, you can then review the changes and submit to the depot.
NB: should in the mean time another developer have made any changes to any of your changed files, Perforce will warn you that you need to execute a Get Latest and then Resolve (i.e. merge) the changes.

How do I interpret the Excluded Changes tree in the Pending Changes window?

What is the status of the files and directories in the screenshot?
It looks like it's telling me that I've changed them all but I haven't - I checked them out and haven't touched them at all.
When you checkout a file in TFS it gets included in the pending changes. That's how it works. As you are using TFS 2012, you probably want a Local Workspace to get a more subversion style Pending Changes, where it only shows files that have actual changes.

How to delete from TFS all files that are deleted from working copy?

I've manually deleted some files/folders in my workspace. How do I pend deletes for those items in my TFS workspace and get those deletes to be reflected in the repository (via command line or programmatic API).
You should be able to use the tfpt online /deletes command from the Team Foundation Server Power Tools. It will prompt you to "promote" any untracked local changes that not in the Server Workspace.
Deleting items within your working folders will not reflect the delete within source control. To delete the items from source control do the following:
Delete it from source control ui, do this by right clicking the item and deleting then committing the change.
Open VS Command line and run the tf properties command, example: tf properties /s:TFSServerCollection "$/FilePath/Filename.jpg"
This will let you retrieve the delete ID, for this example lets say the delete id 12345
In the same VS Command line window, run tf destroy command, example: tf destroy /s:TFSServerCollection "$/FilePath/Filename.jpg";x12345
Don't forget to add the 'x' before the delete ID. Press enter and it will prompt you if you want to delete the item. Say yes, and then press enter. Just be careful as tf destroy complete removed the item and/or folder from source control including it's history.
In Visual Studio 2012: These deletions will be detected, but listed in the "Excluded Changes" section. Open this list and click to "promote" the changes.
Deleted Files can be checked-in like regular changes, however - if you use Solution-Explorer to checkin, deleted files aren't included (because only files which are STILL in the solution are included in the changeset).
I ALWAYS do my checkins via the source-control-explorer - then deleted files are also included in the checkin (if those deleted files are below the source-control-folder you are checkin in)
Greetings
Johannes
P.S.: if you delete the files via windows-file explorer, they aren't marked as "deleted" in your working copy. ALWAYS use VS2010 to delete files (or alternatively the shell extension included in TFS Server-Powertools)

Safely delete a TFS branch project

I'm currently reorganising our TFS source control for a very large set of solutions, and I've done this successfully so far.
I have a problem at the moment where I need to delete a legacy "Release Branch" TFS project that was branched for the old structure, and is no-longer required since I now host a release branch within the new structure.
This is an example of how the source control now looks after moving everything:
$/Source Project
/Trunk
/[Projects]
/Release
/[Projects]
$/Release Branch Project
/[Projects]
/[Other legacy stuff]
So far I've found information that says:
tf delete /lock:checkout /recursive TestMain to delete a branch.
TfsDeleteProject to delete a project
tf delete seems to be only relevant when I need to delete a branch that is within the same project as the trunk, and TfsDeleteProject doesn't seem like it will delete the branch association from the source project (I hope I'm wrong, see below).
Can someone tell me if the above will work, and in what order I should perform them in, to successfully delete the TFS $/Release Branch Project while also deleting the branch association (from right-click $/Source Project -> Properties -> Branches)?
Let me put the facts like this:
Within the context of the TFS source control system, "Delete" is a purely logical operation. You can Undelete at any time. You can have multiple deleted items occupy the same path over time, or even simultaneously. Branch relationships are preserved.
TFS "Destroy" is physical removal. To maintain database integrity, that means all entity relationships are removed too: changeset history, pending change records, shelved versions, merge history, and yes -- branch hierarchy. This Destroy feature was introduced in TFS 2008.
Destroy is the only operation allowed to alter the merge history table (from which branch relationships are determined). All other operations are strictly append-only.
TfsDeleteProject does its best to completely remove all traces of a project, the primary goal being to allow creation of a brand new project with the same name. Some TFS subsystems support physical deletes; some, such as WIT field metadata, only support logical deletes, even in TFS 2008 & beyond. In the case of source control, TfsDeleteProject invokes "delete" in 2005 and "destroy" in 2008+.
In TFS you generally cannot permanently delete anything inside a team project (and TfsDeleteProject deletes a complete team project, but it is not clear if the source control content will actually be removed as a team project is just the top level of the source control tree).
A delete of a file, or whole set of files is just another tracked change, go back into history and it can still be seen.
You could use permissions to make it inaccessible to all. Or rename under an "Obsolete" team project.
EDIT (I finally remembered where this command was):
There is another option, from the command line: tf destroy:
Destroys, or permanently deletes, version-controlled files from Team Foundation version control.
I would expect this to remove the branch records to create the, now destroyed, files... but you might need to check.
Select the branch folder you want to unbranch. then
File > Source Control > Branching and Merging > Convert to Folder.
In VS2013 I couldn't find it under #Radhika answer
I did find it under Team Explorer > Source Control Explorer >right mouse on project > Branching and Merging > Convert to folder
Hope this saves you time.
Edit Copied from comment by #DdW: you need to do a Get Latest Version after converting, before the Delete option will be enabled
REMOVE A BRANCH USING ROLLBACK
Right click on the select branch.
Select rollback to specific changeset.
Enter 1
set.
Choose 1.
The branch will be marked for deletion.
Check in the changes and it will be removed from source control.