DCSIMG
Move your project’s source code using the team source control “Move” command - SRL Group

SRL Group

This blog is about Team System, QA and Development methodologies and more...

VSTS Resources

Team System Bloggers

Move your project’s source code using the team source control “Move” command

 

In this post I like to introduce the source control "Move" option, explain how it works and what to expect when moving the source code from one location to another.

The "Move" command is used for moving source code from one location in the source control (Location A) to a target location in the source control (Location B).

In order to clarify how it works, I will use the following example:

I have created two locations I marked them as "LocationA" and "LocationB".

In "LocationA" I have created a project and I called it "TheSourceToMove".

In order to demonstrate what happens to the history of the project when I move the source code I have created some history entries to the project, the starting point of our example is shown in the screen shot:

History before moving source

Now I will right click the project and click on the "Move" command.

Note: In order to use the "Move" command I must use a workspace definition that is mapping both locations in the source control to my local computer.

Clicking the "Move" button

Next I will choose the new location:

Choose target location button

And finally click "OK".

The source code is now moved to the new location but...

Moving a source code to the new location is not moving all the history of the code to the new location. In order to demonstrate it I will continue the example but this time as a programmer that his workspace is mapped to the new location and I will try to get the version that is marked as "Second version of the code" in the history of the source code.

After moving the source to the new location

In the print screen we can see that the source code is now in the new location and the history is having a new entry: "Checking in to complete the move" this step is essential to finish the move of the source control, all that I have done there is check-in the project in the new location (LocationB in the example).

I will try to get the "Second version of the code" by right clicking the project and choosing the "Get Specific Version..."

Get specific version button

I will choose to get the "Second version of the code", after completing the check-out process I am checking my local folder and see that the local folder that is mapped to the project is empty!!! What happened???

The source control will only move the last version of the source code to the new location, in case I would like to get an older version from the source code history I will need to do it in the old location of the code (LocationA in the example), so before moving a source code from one location in the source control to another verify that the version that you like to work on is located at the top of the history list.

In order to complete the example and show another pitfall to avoid I will continue with the "Get Latest Version..." option.

The latest version is checked out to my local folder from the new location, it is important to remember that from the new location I will only be able to use this version and future versions I will check in from the new location.

So now we got left with one last question, what will happen if I will use the "Get Latest Version..." option to get the latest version, and then I will try to get and older version from the history? The answer is simple the latest version will be deleted from the local computer.

 

As we could see in the example moving a source code from one location to another is not a trivial task and has some pitfalls that need to be considered.

Comments

.NETicated said:

Team System Dogfooding April '08 DevDiv TFS Dogfood Statistics on Brian Harry's blog Can your

# April 16, 2008 5:48 AM

Team System News said:

Steve Andrews on Team System Link Love #7. How Do I: Generate Test Data using VSTS Database Edition....

# April 21, 2008 5:25 PM

links for 2009-12-10 « dstelow notes… said:

Pingback from  links for 2009-12-10 «  dstelow notes…

# December 11, 2009 1:07 AM

Andy Foreman said:

On the one hand, thanks for the information, although really, its useless.  On the other hand, why in the name of God does Microsoft feel so damn compelled to take the simplest of activities (source control) and make it as complex as a mission to the Andromeda galaxy?!?!?

I build a new Class Library and want to add the project to Source Control.  I want it in its own folder.  So I click "Add to Source Control" and where does TFS put it?  Underneath a COMPLETELY unrelated project - why?  Because Microsoft LOVES making me as LEAST PRODUCTIVE as possible.

I now try to move the project, and guess what?  Does it work as easy as you explain?  OF COURSE NOT!!! I want it at the Server root and a typical, very helpful, insanely stupid message box comes up and says "Cannot move to the root"...  Why?  WHO THE HELL KNOWS BECAUSE MICROSOFT CANT WRITE ONE DECENT ERROR MESSAGE, AND NEVER HAS...

I have wasted COUNTLESS hours tinkering with, and tolerating Team Foundation Server - and THIS was supposed to be making me MORE productive!!!  And help?  Oh, no problem - Microsoft only wants a couple hundred bucks to support a product I already paid a small fortune for, and DOES NOT WORK...  What a wonderful racket for MS - almost as good as the Mafia - no wait - better than the mafia...

Build over-complicated, horribly documented, horribly supported, way-over-priced crap - and THEN (!) charge people for support of the most simple of things.  Great formula - Hope Bill and Steve are banking plenty of our money away for their next mansion.

TFS is the software system from HELL - and I sure wish someone would send it back there.

Amazing, source code control is one of the most simple things in the world to do - but of course, Microsoft couldnt do ANYTHING without over-complicating the entire process.

How many Microsoft geeks does it take to change a lightbulb???  20,000...  1 told hold the lightbulb, and 19,999 to spin the world.  At MS, they NEVER do anything the simple, easy, and clear way.

AND I AM LIVING PROOF OF THAT!!!  When I die and get to Heaven I am going to ask God for all the hours back I wasted unproductively with Microsoft products.  It would be a second lifetime.

# December 11, 2009 5:07 PM

Code edition god library name said:

Pingback from  Code edition god library name

# November 12, 2010 7:50 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: