TFS how can I group my files in pending changes window? - visual-studio-2010

If I'm working on lots of things at a time I would like to group the files that I've changed into 'change lists' similar to TortoiseSVN change list feature. Is there a way to do this in TFS?

Is there a way to do this in TFS?
Not in the way linked to (as far sa I can tell).
You can use "Shelvesets" to save ongoing changes (and, optionally, remove them as pending changes in your workspace) which allows saving your state when switching to work on something else.

Related

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

Filter Visual Studio 2013 TFS merge to only files that have actually changed

I am doing a merge between two branches and TFS/Visual Studio 2013 is identifying 1800 files required to be merged. However, doing a diff between the two branches shows that there are only ~100 that are actually different.
The pending changes window mostly corroborates this, as all files are listed with a [merge] status except those which have actually changed; those have a [merge, edit] status.
Is there a way to filter the pending changes list to only show files which are really changed so I can do inspect the differences visually? It is very error prone to have to scroll through and manually do this, skipping items that show only [merge].
My current alternative would be to do a diff on the branches, and specifically look in the pending changes window at files which are identified as different, but that is rather cumbersome for something that should be simple.
Edit: Here is a screenshot of the pending changes window. I only care about the items which are [merge,edit] as it means there is a change and I want to see the diff. Conflicts will be shown in the Resolve Conflicts window. I don't care about [merge] items, as they are identical. There are 1000s of files with no changes, but I want to single out the ones that have changed and inspect the diff.
Try the following trick:
In Team Explorer, Ctrl+A all the included changes, right click and select Undo...
You'll get the Undo Pending Changes dialog with all the items selected. First of all, uncheck everything. Then observe that you have a column named Change and you can sort by it to have all the [Merge] changes stacked together, and you can check them all together and undo only them with a single click.
There is a tool which achieves that, "qbus vMerge" - which is a Visual Studio 2012/2013 plugin available in the Visual Studio Gallery. But it's only free for team projects with up to 5 registered users. In the pre-check-in dialog, you can filter the changes by Edits, Deletes and Adds.
Link:
http://visualstudiogallery.msdn.microsoft.com/cb2f3f5b-7cea-4f2b-9d47-0e51b2619bd0
Confession: i am one of the contributors.
You can do the merge and before checking in the files, just compare your branch folder with the latest version. So if you are merging from anywhere into branch-Servicing for example, Compare $/branch-Servicing with your local workspace for that branch:
You will get a list of all files that are binary different. With a simple double click, you can view the diff.
If you want to view all changes in a merge, excluding merge-only with no changes, the easiest way is to run tf diff from the VS command line. This will use the diff tool on all changed files. I believe this shows adds as well as edits. I do wish you could sort the pending changes window by type of change action like in previous versions.
I have been struggling with the same issue. ChangeType used to be a column that was available in the list view of vs 2012 pending changes. I was hoping it would be added to 2015, but no such luck.
Here is a command-line way of doing this against the pending changes:
tf status {pathToWorkspace} /format:brief /recursive | find ", " > c:\merge.txt
ex:
tf status c:\tfs\main /format:brief /recursive | find ", " > c:\merge.txt
It's not pretty, but at least it gets the filtered list easily.
Summary of: http://thesoftwarecondition.com/blog/2011/05/01/tfs-pending-changes-ignoring-files-which-are-identical-to-the-originals/
Method 1: TFS Power Tools
Install TFS Power Tools and execute tfpt uu /noget /r * in the root of the branch. As a result, TFS will go through and undo checkouts for any unchanged files whilst leaving your modified files untouched.
Method 2: Undo Checkout
Another option is to "Undo Checkout" all the changes, and clicking "No to All" when asked to confirm for undo checkout. This way Visual Studio will "undo checkout" all the files that are not changed, and all the changed files will remain checked out.
Drawback: this method undoes renames.
My question would be why do you care?
If you do the merge TFS will figure out at run time that the files do not need modification and you will not see them as changed in the annotate tool. However if you pick-and-choose the files to merge you will leave a bunch of "pending merges" hanging around that you will have to deal with later anyway...
If there are conflicts TFS will highlight them to you for dealing with.
If you do need to compare before you merge you can use the built in diff tool in Visual Studio that will let you diff a branch (or just folders) local->local, local->Server or Server->server.

Cannot synchronize my project in VisualStudio

My team and I started a project at Azure and we have a git as the VCS/SCM.
One of my partners had made a few changes, and he had commited them. When I try to get those changes at my local repository, and I press sync at the Visual Studio, the following message appears
Cannot merge because there are uncommitted changes. Commit or undo
your changes before merging again. See the Output window for details.
The output window shows the message below
Cannot complete the operation because of existing changes to the
following file:Project\Project.csproj
I have searched everywhere at google, but I did not find anything similar.
Can anyone help me with this?
We are stack.
Thanks a lot
It probably means VisualStudio automatically added some references to the file ProjectProject.csproj, where it keeps general project settings. In VisualStudio 2013 you may do:
Go to the TeamExplorer
Select "Changes"
Search through Included and Excluded Changes, .csproj file is probably there
Right click on it and select compare with unchanged to see the differences
Now choose to commit it or undo the changes (if, for example, the changes are not necessary) to be able to sync with the current repository.
I had this same dilemma and it turned out that somehow the file that was preventing me from switching branches and was in my solution, was not being tracked like the other files were. I just added it to source control via the explorer window, committed and pushed it, then I was able to switch branches just fine. Hope this helps.

When you make edits to a file within a project using AnkhSVN, can this be reflected at the project level?

When I make edits to file, TortoiseSVN will show an indication on the folder that file belongs to that there are changes pending to child items. AnkhSVN only shows (red tick) changes to a project when files are added/removed (because the actual content of the project file in this case has changed)
Can you make ankh give any indication at the project level that child items have been edited?
Unfortunately, no. Ankh only shows an indication on modified files, whereas TortoiseSVN can traverse folders recursively and mark those with changed files within them.
If you desperately need this feature, you can try out VisualSVN plugin. It tries to mimic TortoiseSVN behaviour as close as possible. In fact, it uses TSVN dialogs for operations such as Commit or Update, for instance. When you modify a file within a project, it highlights the file, the project this file belongs to, as well as the solution node in the Solution Explorer.
Unfortunately, it's not free (US $49 per seat), but IMO it is worth its price.
The recommended way to see what changed globally in AnkhSVN is the 'Pending Changes' toolwindow. This shows you all interesting files in a single view and allows you to operate on them easily.
You can open the toolwindow via View->Pending Changes.
Try this:
Right Click the File -> Subversion -> Lock
This places a lock on the file so that others cannot edit it.
When you commit, it should unlock the file.
If it does not, Follow the same steps and select Unlock.
Edit: I use AnkhSVN for my svn but it's just me that uses it. If a corporate environment I mainly use TFS which does the same thing (lock/unlock) but it does not allow others to check out.

SVN Auto Update

I'm using AnkhSVN with Visual Studio 2010.
When I start to edit a file, I'd like to either automatically update the file from the repository, or be warned that it needs updating.
Is this possible?
Would keeping the working copy updated be of use?
If so, you can use this:
How do I automatically update a Subversion working copy?
There's not really a way to do this in Subversion, except when you're using locking and svn:needs-lock on files. The reason is that when you start editing your file can be up to date, but when you want to commit it's changed, and needs updating. Subversion will check for this case and notify you to update when you try to commit.
To get notification of files others are working on, you can go to the "Recent changes" tab in the Pending Changes window (View -> Pending Changes, then click the 3rd tab from the top). You can configure this to update every 'X' time, UI should be pretty self explanatory here.
See my answer here for info on svn:needs-lock, but make sure you understand the pitfalls of exclusive locking of files.

Resources