TFS with old version TFS change-set history - visual-studio

I have an on-prem TFS, In that there are too many change-sets are available. Now I'm using Visual Studio Team Services (VSTS) for same project, but I want to integrate my on-prem TFS change-sets also at VSTS. It means, If in my on-prem in have change-set from id 1 to 987, after integrate I want whenever any developer check-in any code in VSTS it start from 988, not from 1.

There is no documented way I am aware of. You have a tiny tiny thin chance going through Microsoft Support by opening a Service Request (i.e. a support ticket) and hope to touch their heart enough.
If I were you, I would redesign my tools/process to work around this issue e.g. if you use the changeset number in communication prefix with a letter the numbers from the new system.

The 'dirty' solution is to make and commit ~987 non-important changes (add/remove a line etc.) using a script. Afterwards you can destroy those changesets, but you changeset counter is now at the right number.
This absolutely not a pretty solution but I think that you would have more success with it than through the support.

Related

What is a good learning resource for TFS and how to use TFS with Visual Studio?

What is a good learning resource for TFS and how to use TFS with Visual Studio?
Specifically, I want to know two things.
Exactly what are the step-by-steps procedures of checking in code. I know that I am required to do a code review. So, after the code review is done by a peer, I understand that this is not enough and the original developer has to click to do something to submit the code into the TFS system. I mean, I want to know precisely what buttons to click on.
I also want to know how to use Visual Studio to look up the actual version. How do I determine the details of what is already checked in?
There are many blogs videos in google. If you want a full detail resource, suggest you directly take a look at our official doc here -- Azure DevOps Server Documentation
A suggested learn order for your reference:
Installation (you could skip this if your company already done this)--
Code -- Build&Release -- Packages-- Test-- Work-- Analysis-- Admin
Tool
TFS supports two types of version control: Git and Team Foundation Version Control (TFVC). One centralized and one distributed. As for which version control system should you use, you could take a look at this thread: Choosing the right version control for your project
For your case, you could easy check the history in server side. It's called changeset in TFVC and commit in Git.
For example, when you check in your changes, they are stored on the server as a changeset. Changesets contain the history of each item in version control.
You can view a changeset to see what the exact file changes were, discover the owner's comments, find linked work items, and see if any policy warnings were triggered.
The same as Git, actually you could find the answer for both question 1&2 in Code part. Hope it helps.

Using Visual Studio Online (VSO) without Visual Studio

I would like to use VSO as App life cycle management (ALM) tool for other platforms, native android development to be specific. I understand that I can use it for sprint planning and related things.
However, I would like to associate my checkins with BLIs/Tasks/Features.
I think if its achievable then raising pull requests should be as per flow.
Yes, it is possible for you to associate checkins with Tasks or Features work items.
You can do it via opening the work item in IE, and go to All Links tab, select LinkTo and choose Changeset link type. See:
If you are using Git repositories in Visual Studio Online, work items are linked to commits by using the notation #1234 using the work item number. The server will see it and automatically associate the work item with ID of 1234 to that commit and use it in other locations like builds, pull requests, etc.
We call the feature "#mention" and you can see more information about it here: https://www.visualstudio.com/en-us/news/2015-jun-3-vso.aspx

Is there a method / system / program to keep track of different stages and changes in writing the code for a project?

Forgive me, but I don't know the technical term to know what to search for.
I am trying to find a way to keep track of changes in my code during the development of my program. something that would allow me to go back to a section of code that I deleted. I am not talking about "undo". But rather a way that would let me keep track or be able to retrieve a section of my code that I deleted but now want it back.
Is there such a way? If there is, then what is this whole system/procedure called? Is there something that integrates with Visual Studio 2010?
you could use
SVN
or
GIT
but for local use, I would prefer SVN. its free and its easy.
For visual studio there are a few SVN client plugins (like VisualSVN). But, I would suggest TortoiseSVN as the client.
To be clear, SVN is the server, TortoiseSVN is the client. (Both are free open source tools)
It's called Revision Control.
The term you are looking for is Source Control. Modern source control's provide all the functionality you described plus much more.
Team Foundation Server seamlessly integrates into VS2010 and is very useful. Read through Source Control for Visual Studio to get up to speed.
I'm not familiar with Visual Studio, but generally there are two approaches to implementing this:
1) Source/Revision control - But the problem is that it is very low-granularity, you usually commit a file when it is ready, but lose any interim changes. There are a lot of solutions compatible with visual studio.
2) A local history that tracks multiple versions between commits. Eclipse has this built in, not sure how to access it in VS.
3) A very granular log of all your development activities so you can examine and revert past changes. Not familiar with a commercial version of this. I once developed something like this for Eclipse.
Please read this thread here at SO: Keeping track of changes I make by copying project folders.
subversion has a lot of mind share these days, but it's very old-school, first-gen tech. Distributed revision control is gaining a lot of momentum and I'd highly recommend that you become familiar with it if you're going to be a code monkey professional. Look up mercurial (also referred to as hg) or bazaar. If nothing else, perforce - a professional, commercial revision control tool - is free for up to two users. It works very well, as long as you keep your branching craziness to a minimum.
Every source control does that, you know ;)
YOu have a legal VIsual Studio 2010? Try Team System.

SVN plugin for VS2008

I'm using VisualSVN with my Visual Studio 2008 and I have to run some sort of commit monitor in the tray area to see if the local copy of project is out of date.
I have two problems with that:
I hate to have it in two places, I want to see that as an icon in my VS,
The commit monitor software keeps an eye on several projects, when I work on project 1 (which VS knows about), I'm not interested in other projects.
I couldn't find any addons for Visual Studio to do that and was wondering if anyone knows about anything good.
Generally, you have 2 options (besides running commitmonitor as you already do):
run update before you start to change something
ignore it all and merge with any updates when you want to commit.
SVN's really designed around the 'wait until you're ready and merge it all together' model, as there's no guarantee that even if you update your working copy immediately before starting to modify it, someone won't commit changes before you've had a chance to commit. So, let the system do the work for you.
The ultimate alternative if you are worried about conflicts is to use the svn:needs-lock property which means you will have to get a lock on any file you modify before modifying it, and you won't be able to get a lock on a file someone else is modifying.
You might like to ask the VisualSVN people if they'd add an option to check the repository when a project is loaded by VS (or run AnkhSVN and implement this feature yourself).
Work has started in AnkhSVN in this direction, we started to implement the 'Synchronize View' that's also used in Eclipse/Subclipse. The things still missing are: Scheduled checking of the repository, and maybe a notification inside VS to tell you that something has changed.
Right now you can manually refresh this view to see local and remote changes (and merges which can be potential conflicts). Patches are welcome to extend this feature :-)
I'm assuming VisualSVN is your "server" (even if running on the same machine).
AnkhSVN is a good Visual Studio Integrated SVN Client.

TFS annotate/blame summary report for a project

In Team Foundation Server, I know that you can use the Annotate feature to see who last edited each line in a particular file (equivalent to "Blame" in CVS). What I'd like to do is akin to running Annotate on every file in a project, and get a summary report of all the developers who have edited a file in the project, and how many lines of code they currently "own" in that project.
Aside from systematically running Annotate of each file, I can't see a way to do this. Any ideas that would make this process faster?
PS - I'm doing to this to see how much of a consultant's code still remains in a particular (rather large) project, not to keep tabs on my developers, in case you're worried about my motivation :)
It's easy enough to use the "tf.exe history" command recursively across a directory of files in TFS. This will tell you who changed what files.
However what you're after is a little bit more than this - you want to know if the latest versions of any files have lines written by a particular user.
The Team Foundation Power Tools ship with a command-line version of annotate called "tfpt.exe annotate". This has a /noprompt option to direct the output to the console, but it only outputs the changeset id - not the user name.
You could also use the TFS VersionControl object model to write a tool that does exactly what you need.
If you install the TFS Power tools (at least for VS2005); it's called annotate.
It might be part of VS2008...
You can use TFS Analysis Cube to see generate a code churn report, which I believe is something you would like.
Annotate is now part of Visual Studio (I think it was introduced in VS 2010).
Docs
I'm writing an answer to an 8 year old question :). Its not really a full answer, but a suggestion to look into excel reports for TFS.
TFS2013 / 2015 on prem has something has an excel report that can be used to visualize Code Churn.
In VS open team explorer then select "Documents" then explode "Excel Reports". I believe Code Churn report has something like discussed. The report is made by some default project template so I think tfs2013 on prem just creates it.
Code Churn Excel Report VS2015
https://msdn.microsoft.com/en-us/library/dd695782.aspx
I had very similar requirement to get details of particular attribute in a file e.g. who added, when, related work items etc.; Following GitHub project is having implementation to get required details and required minimal changes to work with multiple files or project -
SonarQube SCM TFVC plugin
It requires analysis to be executed from Windows machines with the Team Foundation Server Object Model installed (download for TFS 2013).
This blog post is also having good explaination and sample application -
TFS SDK: Connecting to TFS 2010 & TFS 2012 Programmatically

Resources