Introduction

Introduction

 This is the first topic Next topic

Introduction

 This is the first topic Next topic

The Problem :

Can any of you (older ?) guys remember the adage :-

"There are two types of Hard Disk user, those who have had a disk crash, and those who

will have a disk crash in the future."

Well, if you are old enough for that to 'ring bells' then you will also appreciate that a similar situation

exists with coding, and saving application design and creation details in solution and project based

file groups.

I have to come clean and admit that I personally have been living dangerously for years (many years)

and was one of those lucky guys who had never really lost anything (much) as far as coding is concerned.

That is until a couple of weeks back, when I was working on a complex data logging application based on

ADO.NET and LINQ. Suddenly, for some reason unknown to me, I lost a solid four hours of coding and testing.

To this day I am not sure at all what happened :(

From that awful moment I looked out an answer to my problems - some type Version Control Software so this

would never happen again. "Once bitten, twice shy" is the phrase which comes to mind :((

I think at that point the only thing I appreciated about 'VCS' was that some of my reliable friends and colleagues

had been using such for years, and that you didn't need to be working in a Team to benefit from it.

That was about all I knew, Oh! and that it may incur a cost - i.e. cost me a lot of cash !!

The Reality :

With a little bit of questioning colleagues, and also searching the web, I found out that it was possible to

legally acquire and use more than one professional software package to do the job.

Yes, we have a choice ;-0)

Colleagues told me of Mercurial, or MercurialHG, and some supporting bits and bobs, which was free to acquire.

However, no one told me that with Visual Studio release 2012, we had now Express versions of VS itself,

SQL Server 2012, and also Team Foundation Server 2012 (TFS). There are others.

Visual Studio 2010 (called version 10 by Microsoft) did not have a TFS Express version.

So this recent news is VERY good indeed for us developer guys.

MSDN members :

Members of Microsoft's "MSDN account for VS Pro.", already have a 'full' licence of TFS available to them.

So get a full version if possible, else get an Express version from a free download.

The limitation seems to be that Teams larger than 4 or 5 ? need a full version to carry out Team Development,

but single guys and small teams can use the Express version.

What is covered in 'ClickStartVCS' :

I will do my best to cover the two flavours of VCS mentioned above, but I have to admit that now I know that

TFS is free to all developers, then I am personally motivated heavily towards doing a good job on TFS ;-0)

I will see what I can do to help with Mercurial and any other which is worthy of effort.

PHH - 24th. November 2012.


What is 'Version Control' ?

What is 'Version Control' ?

 Previous topic Next topic

What is 'Version Control' ?

 Previous topic Next topic

Now that we have a basic idea why we need VCS, and what is available for us to acquire and use,

let us turn our attention to what 'version control' software actually does for us, and generally how we

may use it.

If you imagine developing one of your apps., and at certain points (key points) you have tested your

latest code additions and changes, to convince yourself that all is well - that is when you need to save

the app code as a 'version'. In this case, and generally for most guys, it will be the next version in a long line.

With VC software in place, we keep many versions, one after another, and each at a 'key' point.

Usually, the 'key' point is when a raft (bunch) of changes has been added and testing successfully completed.

The VCS keeps track of all changes made from one version to the next, and issues the bunch of changes with

the next version number , or identity..

At this point you need to realise that changes made to solution, project, and code files, between these 'key'

points are lost to the system and you, forever.

In many ways the same as when we use 'Ctrl + S' during a simple text editing session, or even the 'Save As'

when we keep another file, with a different name.

So versions are 'key' points on the path to app development, and as such with VCS we may at any time go

back to any of our saved version 'points' and view and run the code.

We can't go back to between versions!

It is recommended by good sources that we make more versions rather than less. That means we have less

development work and effort between versions, and therefore have more of a 'fall back' strategy in place.

It is even suggested that if you have done an afternoon's work, but still have issues to correct, and more tests

to perform, you still make a version before closing down for the day. Just make sure that you make enough

annotations and useful descriptions, to tell yourself what has and hasn't been done.

But the way - you need to realise that if we decide to go back an use an earlier version of our app., we can

then jump forward again in order to use a later version, and so forth.

What I am not sure about yet is whether it is a good rule to say that we should not use an earlier version as

a master copy - one which to change and move forward !?

To this point I have used my TFS versions effectively as separate at individual backup code copies, on my

way from A to B. Where A is the start of development, and B is the completion of development.

Now then, so far we have talked of the general idea of tracking versions, but now we need to consider how

we can use the software with different office scenarios. Whether we are a single developer, or part of a team.

To me it seems that we would all need to apply a tighter strategy, and set of rules, when we work as a team

as opposed to an individual. My experience so far is as an individual.

I would like you to see an image of the 'change sets' which I have in my SQL Server database for the Data Logger

application I have been working on for many months.

Note that I have asked the system to find sets with numbers from 39 to 52, and also note that not all numbers

have been found - we will look into that later - for now study the following details :-

===========================================================================================================

If we view the History we see that quite a few Changesets are missing according to the numbers.

This simply may have to do with the fact that I saved changes to only one or a few of the files checked into

the versioning system.

A 'Changeset' is what it says it is, a 'Set' - of all possible files to be 'Checked-In'.

Here is my History pane but with a lot of recent 'Changesets' not shown - they currently go up to 106.

===================================================================================================

In the above image notice that 49 through 56 are missing, as too are 61 - 63 and also 65 -87.

==========================================================================================

Let us now consider the single developer guy ............

The Sole Developer :

A Team of Developers :

PHH - 24th. November 2012.


Life before VCS

Life before VCS

 Previous topic Next topic

Life before VCS

 Previous topic Next topic

PHH - 24th. November 2012.


Life after VCS

Life after VCS

Life after VCS

 Previous topic Next topic

PHH - 24th. November 2012.


Life as a single, or mult user

Life as a single, or mult user

Life as a single, or mult user

 Previous topic Next topic

PHH - 24th. November 2012.


My software platform - for these eNotes

My software platform - for these eNotes

My software platform - for these eNotes

 Previous topic Next topic

So that you can follow through as much of the contents of these eNotes as possible, you need

to know exactly what software I have installed on this desktop development system of mine, here

in my office.

First of all I have Windows 8 Pro x64 bit - the final RTM version published for MSDN members. This

should be the standard public release :-

=================================================================================================================

Secondly I have both Visual Studio 20012 (called VS11, as it is their version '11'), and VS2010.

All the updates, and any service packs, for the above should be installed too.

==================================================================================================================

Then I have MS SQL Server 2012 - called 'Denali' and this has a version number of '11' as can be seen in the

following image :-

==================================================================================================================

So Visual Studio 2008 was version '9', and VS2010 was version '10' - now VS2012 is version '11'.

=========================================================================================================================================

================================================================================================================================

PHH - 24th. November 2012.


Learning materials

Learning materials

Learning materials

 Previous topic Next topic

eBooks & Books :

Free eBook download from :- http://it-ebooks.info/book/1427/

Above eBook by Blankenship et al.

The above eBook downloads and opens into Adobe Reader 11 on Win7 platforms OK.

I downloaded my copy on 1st. February 2013.

Below is a paper format Book I acquired :

==============================================================

=======================================================================================================================================

=====================================================================================================================================

=====================================================================================================================================

Web Links :

Team Foundation Server :-

http://team-foundation-server.blogspot.co.uk/2008/01/how-we-branch-our-code-in-tfs.html

http://intovsts.files.wordpress.com/2010/06/techdays2010_branchingandmergingwithtfs2010.pdf

http://tfs.discountasp.net/KB/a1075/getting-started-with-team-foundation-server-2012.aspx

http://geekswithblogs.net/jakob/archive/2012/09/05/get-started-using-build-deploy-test-workflow-with-tfs-2012.aspx

Mercurial - TortoiseHg :

http://mercurial.selenic.com/

http://tortoisehg.bitbucket.org/

http://visualhg.codeplex.com/

http://mercurial.selenic.com/quickstart/

http://tekpub.com/productions/hg

PHH - 24th. November 2012.


Chapter 0 - Which software to use

Chapter 0 - Which software to use

Chapter 0 - Which software to use

 Previous topic Next topic

============================================================================================================================================================

PHH - 24th. November 2012.


Chapter 1 - Where to start - 'VisualHG'

Chapter 1 - Where to start - 'VisualHG'

Chapter 1 - Where to start - 'VisualHG'

 Previous topic Next topic

Getting Started :

Here is some encouraging information from the download site - read it carefully :-

=================================================================================================

Download :

http://visualhg.codeplex.com/

============================================================================================================================================================

Installation :

==============================================================================

======================================================================

Installation Check :

=========================================================================================================================================

Too Quick :

==================================================================

http://tekpub.com/productions/hg

Creating a Repository :

==================================================================

=======================================================================================================================

======================================================================================================

=========================================================================

======================================================================================================================

========================================================================================================

===============================================================================================================

Results as Seen in the SE pane :

==================================================================================

============================================================================================================================

=======================================================

PHH - 24th. November 2012.


Chapter 2 - Where to start - 'TFS'

Chapter 2 - Where to start - 'TFS'

Chapter 2 - Where to start - 'TFS'

 Previous topic Next topic

I will assume that you wish to use Team Foundation Server (TFS) software because you have it to hand,

or that you know it will do the job for you, and a good job too.

Personally, I came to TFS because I had a copy from my MSDN subscription for Visual Studio. It is

currently available to those folks with standard VS Pro MSDN accounts.

We will talk first about the 'full' version of TFS, but the good news is that with versions of VS 2012 and supporting

application like SQL Server 2012, we also get Express versions of all the VS suite including Team Foundation

Server. I will discuss Express TFS in the next subsection from here.

So back to details of the 'full' version.

Here is what a guy with MSDN VS Pro will see in their MSDN accounts area :-

============================================================================================

=========================================================================================================================

PHH - 24th. November 2012.


Express - FREE version

Express - FREE version

Express - FREE version

 Previous topic Next topic

Warning to all :

The first thing to know is NOT to try and install a copy of Express TFS onto a PC system which

already has a full version installed - this is what you see on screen :-

===================================================================================

Remember :

If you can acquire and use a legal full version of TFS then do so.

Here is a link which works on January 20th. 2013 :-

http://www.microsoft.com/visualstudio/eng/downloads#d-team-foundation-server-express

The URL will show in your Browser as that displayed below :-

=======================================================================================================

Okay then, so we find a PC without TSF but with a version of VS 2012 and also SQL Server 2012 installed.

Before you download and install Express TFS you need both of the above to be installed on your system.

Once again, if possible get full legal copies of VS and MS SQL Server 2012 (MSSS).

Upgrade to the latest service pack on both VS and 'MSSS'.

Now you are ready to click the 'Install now' as shown in the above image.

PHH - 20th. January 2013.


'Full' version - download and install

'Full' version - download and install

'Full' version - download and install

 Previous topic Next topic

PHH - 20th. January 2013.


Chapter 3 - Making a start - 'VisualHG'

Chapter 3 - Making a start - 'VisualHG'

Chapter 3 - Making a start - 'VisualHG'

 Previous topic Next topic

PHH - 24th. November 2012.


Chapter 4 - Making a start - 'TFS'

Chapter 4 - Making a start - 'TFS'

Chapter 4 - Making a start - 'TFS'

 Previous topic Next topic

This chapter will assume that TFS is already installed onto your PC system. As too Visual Studiio

version 11, or 2012, and SQL Server 2012 (codenamed 'Denali').

The aspects of TFS we will explore in this chapter will be those which any developer will need

in order to create and edit files within a new solution.

So we will make a new Project (in a new solution) and then add files relevant to a WPF form we will

develop.

As we make code, and other changes, we will keep "Checking In" the project to create a number of

versions of the application.

For this chapter we will use C# as our chosen programming language, simply because it is all I have

at the moment in VS11 with which I am familiar.

However, in later chapters and in a few weeks time, I will use Vulcan.NET version 3, which is fully

integrated into VS2012.

As far as I can tell at the moment, any VS language available within your VS 'shell' should work the

same way as regards the TFS operation is concerned.

So lets get to it and see some action !

See you in the next subsection .................

PHH - 21st. January 2012.


Creating a new Solution / Project

Creating a new Solution / Project

Creating a new Solution / Project

 Previous topic Next topic

Open your VS11 shell and close any open solution.

Go to the main menu bar and select File, New, Project .... as shown below :-

=======================================================================================

For the moment notice the other option of 'Team Project' but do not use it for the moment.

==========================================================================================================================

=================================================================================================

======================================================

====================================================================================================================================================

================================================================================================================

================================================================================================================

Use 'Ctrl+Z' to replace the text we tried to remove.

===========================================================

=======================================================

===================================================

===============================================================

=======================================================

============================================================================================================

==================================================

=======================================================================================================

==============================================================================================================

============================================================================================================

===========================================================================================================

========================================================================================================================

===========================================================================================================================

============================================================

====================================================================================================

==============================================================================================

==============================================================================================

========================================================================================================================

=================================================

==================================================

===============================================================================

PHH - 21st. January 2012.


Adding the Project to TFS

Adding the Project to TFS

Adding the Project to TFS

 Previous topic Next topic

PHH - 21st. January 2012.


Checking in the Project intially

Checking in the Project intially

Checking in the Project intially

 Previous topic Next topic

PHH - 21st. January 2012.


Making changes and Checking-In

Making changes and Checking-In

Making changes and Checking-In

 Previous topic Next topic

PHH - 21st. January 2012.


New files, then Checking-In

New files, then Checking-In

New files, then Checking-In

 Previous topic Next topic

PHH - 21st. January 2012.


Viewing the 'History'

Viewing the 'History'

Viewing the 'History'

 Previous topic Next topic

==============================================================================

==================================================================================================================

PHH - 21st. January 2012.


Seeing different versions

Seeing different versions

Seeing different versions

 Previous topic Next topic

=================================================================================================

=========================================================================

==============================================================================================================

=========================================================================

==================================================================================================

==================================================================================================

================================================================================================

PHH - 21st. January 2012.


Checking-In single or multiple files

Checking-In single or multiple files

Checking-In single or multiple files

 Previous topic Next topic

PHH - 21st. January 2012.


Chapter 5 - Going further - 'VisualHG'

Chapter 5 - Going further - 'VisualHG'

Chapter 5 - Going further - 'VisualHG'

 Previous topic Next topic

PHH - 24th. November 2012.


Chapter 6 - Going further - 'TFS'

Chapter 6 - Going further - 'TFS'

Chapter 6 - Going further - 'TFS'

 Previous topic Next topic

======================================================================================

======================================================================================

======================================================================================

================================================================================================

=======================================================================================

======================================================================================

============================================================================

PHH - 21st. January 2012.


Chapter 7 - a strategy when using 'VisulaHG'

Chapter 7 - a strategy when using 'VisulaHG'

Chapter 7 - a strategy when using 'VisulaHG'

 Previous topic Next topic

PHH - 24th. November 2012.


Chapter 8 - a strategy for 'TFS'

Chapter 8 - a strategy for 'TFS'

Chapter 8 - a strategy for 'TFS'

 Previous topic Next topic

PHH - 24th. November 2012.


Chapter 9 - seeing 'VisualHG' in action

Chapter 9 - seeing 'VisualHG' in action

Chapter 9 - seeing 'VisualHG' in action

 Previous topic Next topic

PHH - 18th. January 2013.


Chapter 10 - seeing 'TFS' in action

Chapter 10 - seeing 'TFS' in action

Chapter 10 - seeing 'TFS' in action

 Previous topic Next topic

Probably the easiest way of 'easing' ourselves into Version Control (VC) with Team Foundation

Server (TFS) is to look at the VS 2012 (VS11) 'shell' after I have been developing a C# application

for quite a few weeks.

Let us first look at part of the folder structure of this app in the Solution Explorer pane (or Tab).

The application is called "GroundProbeCS12".

Let us examine the image before we discuss a few detailed parts :-

=================================================================================================================

In the above image we see some new items for us to first of all be aware of, and then secondly

investigate.

The red tick, next to a 'C#' symbol (better seen in the RHS image) means that we have unsaved

changes. When I say 'unsaved' I am speaking generally, the technical term is that the changes

are saved locally, but not 'Checked In'.

If this was a Team project, then only 'Checked In' changes are available to others in the Team.

So local changes (we are used to using 'Ctrl+S') are NOT available to others. For others to be able

to see changes they need to be 'Check In'.

While we are on the topic of unavailable local changes (not Checked In) take a look at the following

image which shows a bunch of such code files - four to be precise.

Study these details :-

======================================================

Okay, we can clearly see which CS files have local changes, so how do we check these in ?

Well, one thing we need to realise is that files may be checked in either singularly, or in groups,

or batches.

Let us right click on an item with a red tick - see below :-

================================================

========================================================================================

=====================================================================================

PHH - 18th. January 2013.


Team Explorer tab

Team Explorer tab

Team Explorer tab

 Previous topic Next topic

============================================================================================================

================================================================

=============================================================================================

Settings :

=======================================================

Group Membership :

==================================================================================================================================

=================================================================================================================================

=========================================================================

============================================================================================

PHH - 18th. January 2013.


Checking In

Checking In

Checking In

 Previous topic Next topic

PHH - 18th. January 2013.


Checking Out

Checking Out

Checking Out

 Previous topic Next topic

PHH - 18th. January 2013.


viewing History

viewing History

viewing History

 Previous topic Next topic

PHH - 18th. January 2013.


getting Versions

getting Versions

getting Versions

 Previous topic Next topic

PHH - 18th. January 2013.


making Annotations

making Annotations

making Annotations

 Previous topic Next topic

PHH - 18th. January 2013.


undoing pending Changes

undoing pending Changes

undoing pending Changes

 Previous topic Next topic

PHH - 18th. January 2013.


making Comparisons

making Comparisons

making Comparisons

 Previous topic Next topic

PHH - 18th. January 2013.


Team - menu bar otions

Team - menu bar otions

Team - menu bar otions

 Previous topic Next topic

So far we seem to be getting on quite nicely with our exploration of the Team Foundation Server

facilities now within the VS11 'shell'.

However, we do need to notice that in the main menu bar of VS11 we have a

PHH - 19th. January 2013.


Chapter 11 - adding a Project to a Solution

Chapter 11 - adding a Project to a Solution

Chapter 11 - adding a Project to a Solution

 Previous topic Next topic

PHH - 18th. January 2013.


Chapter 12 - starting a new Solution

Chapter 12 - starting a new Solution

Chapter 12 - starting a new Solution

 Previous topic Next topic

PHH - 18th. January 2013.


Chapter 13 - adding existing solution to SC

Chapter 13 - adding existing solution to SC

Chapter 13 - adding existing solution to SC

 Previous topic Next topic

Okay the guys, I have an existing small application which so far has not as yet been put under

'Source Control (SC) using our TFS facility on this machine.

Here is how it looks in the Solution Explorer (SE) :-

====================================================

=======================================================================================================

=================================================================

===================================================================

Now look at Advanced options :

=======================================================================================

Click OK twice to close the dialog screens and save the input details.

====================================================

================================================

======================================================

=========================================================================

====================================================

====================================================

================================================

====================================================

============================================================================================

======================================================================================================

===================================================================================================

================================================================

===============================================================================================================================================================

===============================================================================================================================================================

==================================================================

PHH - 18th. January 2013.


Chapter 14 - Moving a Project to another PC

Chapter 14 - Moving a Project to another PC

Chapter 14 - Moving a Project to another PC

 Previous topic Next topic

PHH - February 1st. 2013


Appendix A - 'Tip and Tricks'

Appendix A - 'Tip and Tricks'

Appendix A - 'Tip and Tricks'

 Previous topic Next topic

PHH - 24th. November 2012.


Appendix B - starting a new METRO app.

Appendix B - starting a new METRO app.

 Previous topic Next topic

Appendix B - starting a new METRO app.

 Previous topic Next topic

========================================================================================

===============================================================

PHH - 3rd. January 2013.


Appendix C - Image files in project

Appendix C - Image files in project

 Previous topic This is the last topic

Appendix C - Image files in project

 Previous topic This is the last topic

====================================================

==================================================================================================

===========================================================

=====================================================

=================================================================

====================================================

PHH - 4th. January 2013.