Subversion - Can't commit message & View History - visual-studio

Which tortoise subversion which integrated with Visual Studio can be able to enter messages while committing, view history of others and my file

The functionality you're describing is not specific to Tortoise, it's a standard functionality of Subversion itself. However, you have the option of integrating TortoiseSVN in Visual Studio as well as just using VisualSVN if you're trying to integrate a SVN client into VS.
That being said, if you're using TortoiseSVN, simply right click on the file folder you want to commit and click SVN Commit... and specify your comment as normal. To view the history of a file or folder, right click on the file or folder and go to TortoiseSVN > Show Log... to see the revision history.

Related

Visual Studio reverts source control to ankh svn when opening project

I had used Ankh SVN to do source control for a project but now I want to use a TFS server but I can't as Ankh is set as default every time I open the project. I also removed all .svn files so it's not linked to subversion anymore.
How do I overcome this behaviour.
You need to change the source control bindings to point to TFS instead of to SVN.
With the solution open, go to "File" -> "Source Control" -> "Advanced" -> "Change Source Control Provider".

Tracking changes in Visual Studio

Is it possible to set up Visual Studio (2010) for tracking changes (left color symbols) not from last file open state, but from source control commited state? This is how netbeans works and it is really great feature, especially reverting text block from editor by right click... Visual Studio default tracking mode is not much useful.
EDIT 1:
Something like this way:
EDIT 2:
Now it works with latest Git Source Control Provider (http://visualstudiogallery.msdn.microsoft.com/63a7e40d-4d71-4fbb-a23b-d262124b8f4c) extension. Good job, extension developers. Left bar is standard visual studio tracker, right bar is tracker tracking changes against last commit. See picture:
EDIT 3 (12/05/2015):
Now I use standard VS git tools and for change tracking great Git Diff Margin extension. I use it with VS2013 and 2015 and it works very well. See:
For people like me that skim straight to the answer -
OP (12/05/2015) - Now I use standard VS git tools and for change tracking great Git Diff Margin extension. I use it with VS2013 and 2015 and it works very well
Git Diff Margin
Works great for me as well!
Seems like if you have Visual Studio 2013, and you're working with GIT, it does work.
Also, you can see what happens in the Team Explorer tab.
There is no such facility in VS to do this. I rely on CTRL-Z to undo. If there are too many changes, you can do a git checkout -p -- . which will walk you through all the differences and apply the ones you need. The -p (or --patch) parameter is available on git reset, git add and git checkout.
That being said, one could write an add-in to VS to give you this view.
Also, I use CTRL+- and CTRL+SHIFT+- to move back and forth between my recent cursor positions.

Visual SVN client commit solution files only

I have VisualSVN client integrated in my Visual Studio and I want to commit modified files. The problem is when I right-click on the solution file item in the solution explorer and choose 'Commit', VisualSVN is trying to commit all modified files in my trunk. This is the same problem if I choose 'Commit' from the VisualSVN menu item.
Is it possible to just show the modified files linked with my solution and not all the trunk files?
I know that with AnkhSVN, this works perfectly but I think I missed something with VisualSVN client.
Use VisualSvn menu or context menu in Solution Explorer and choose "Show Changes". It could also be that you have fiddled with the VisualSvn->"Set Working Copy Root" option. Set it back to automatic mode if possible.
As VisualSvn uses TortoiseSvn in the background, it works only with folders so if there is a modified file in the folder not belonging to the solution side by side with a modified file belonging to the solution you will see both files.

Open Project from SVN

My primary dev workstation has tortise and visualSVN installed and VS10 offers me a command off my File menu - 'Open Solution from SVN' - (or something to that effect...I can't open that workstation right now so the wording is probably different. But the point is that i has a way to open a project that stored at my VisualSVN server and all files are copied down to my workstation with source control active. I can 'update to latest' and make my commits.
I'm trying to get to that same level of functionality on a new workstation - have both tortise and visualSVN installed...and within VS10 i have the VisualSVN menu and tortiese context menu items. But I'm not seeing the 'Open from SVN' at the file menu and don't see how I'm supposed to import the project from the VisualSVN server.
.
.
NOTE: I was just able to reboot that server (hope springs eternal) and verify the menu struture...On Visual Studio's main File menu - at the top - is "Open" where the only item is a flyout menu - the only item on that is 'Open From SVN'. This is what's missing on the new workstation's visual studio implmentation.
Can't you just do a SVN Checkout using Tortoise and open the solution file in VS?

How to rollback in Visual Studio TFS?

I'm working on one sub-module of a large project for which is use VSTS 2008.
I have a need to rollback the module to an earlier version (about 4 check-ins previous). I tried to do this in the Visual Studio UI, and finally realized there is no option to rollback.
After some research, I determined there is a power tools download that purports to support rollback via a command-line tool. However, there appears to be virtually no documentation for it.
Can anyone describe step by step how to rollback to a previous version in VS2008? (Using Power Tools or otherwise).
Bonus question--anyone know if we might get more robust rollback support in VS2010?
Right-click on the folder in Source Control Explorer. Choose Get Specific Version. Choose the version that you want to get (by changeset, date, label, etc).
EDIT: At this point your local version will be the version that you want. Check out the changed files and then check them back in. This will bring up the merge wizard and it will probably be complaining about how the server has a newer version than you do. Go through the wizard and merge the files the way you want them (one of the options is to discard the server changes, which is what it sounds like you want). At the end of this process, it may tell you that no files were checked in due to the merge process (or something of that nature), just hit OK and then check in again. This should accomplish what you need.
This has luckily been made much easier in TFS 2012. Now there is a Rollback option from the GUI.
MSDN has more information on how to do it, and what options are available.
Here is the text from MSDN on how to rollback to a specific version:
To roll back to a specific version:
In Source Control Explorer, select an item, open its shortcut menu, and choose Rollback.
In the Rollback dialog box, select Rollback to a specific version.
You can of course also rollback entire changesets or a collection of changesets. And you can also easily rollback to a specific point in time if you wish.
There IS a way but I don't find it pretty.. Open Visual Studio command prompt and ..
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>tf rollback -?
TF - Team Foundation Version Control Tool, Version 10.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Rolls back the changes in a single or a range of changesets:
tf rollback /changeset:changesetfrom~changesetto [itemspec] [/recursive]
[/lock:none|checkin|checkout] [/version:versionspec]
[/keepmergehistory] [/noprompt] [/login:username,[password]]
tf rollback /toversion:versionspec itemspec [/recursive]
[/lock:none|checkin|checkout] [/version:versionspec]
[/keepmergehistory] [/noprompt] [/login:username,[password]]
Versionspec:
Date/Time D"any .Net Framework-supported format"
or any of the date formats of the local machine
Changeset number Cnnnnnn
Label Llabelname
Latest version T
Workspace Wworkspacename;workspaceowner
The August 2011 TFS Power Tools added full rollback support right into the Visual Studio 2010 UI.
Download link: http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f
This function is also included with TFS 2012.
Bonus question--anyone know if we might get more robust rollback support in VS2010?
Yes. Unlike the Power Tools, which is coded directly against the existing 2008 client API, TFS 2010 has a new API for executing rollbacks directly on the server. This makes them far faster and more reliable, while adding functionality that wasn't possible at all in 2008 such as reverting merge history.
From the MSDN article How to: Roll Back a Changeset (VS2008 although other versions are available)
To revert to an earlier version of a
file
In Source Control Explorer, right-click the file that you want to
roll back, and then click Get specific
version. The Get dialog box appears.
Under Type, click Changeset.
Under Changeset, click the ellipses (…).
In the Find Changesets dialog box, either use the default values or
specify criteria for your search, and
then click Find.
Under Results, click the changeset that contains the version to which you
want to revert the file, and then
click OK.
In the Get dialog box, select the Overwrite writable files that are not
checked out check box, and then click
Get. The earlier version of the file
is copied to your local working
folder.
In Source Control Explorer, right-click the file, and then click
Check Out for Edit.
In the Check Out dialog box, click Check Out.
In Source Control Explorer, right-click the file again, and then
click Check In Pending Changes.
In the Check In - Source Files dialog box, click the file, and then
click Check in. The Resolve Conflicts
dialog box appears, and a message
explains that no files have been
checked in because the two versions
have changes that conflict.
In the message box, click OK. The Pending Changes – Conflicts window
appears.
(Optional) In the toolbar of the Pending Changes window, click Compare
Local to Server. The server and local
copies appear side by side so that you
can review your decision before you
roll back the changes
In the Pending Changes window, click Keep Local Version.
In Source Control Explorer, right-click the file, and then click
Check In Pending Changes.
In the Check In - Source Files dialog box, click Check in.
In Visual Studio 2013 this became an easier task. To Rollback, do the following:
In Source Control Explorer, select the solution/project
Right-click, then select "View History"
In the history view, select the changeset you want to roll back
Right-click, then select View changeset details. This opens up the Team Explorer.
In the Team Explorer, click "Rollback":
To make the rollback permanent, you need to check in now. Or you can make changes to the rolled back version and then check in.

Resources