Profilo di StevenDevelopmentalBlogElenchi Strumenti Guida

Blog


07 gennaio

TFS: After a rename, I can’t get a specific changeset!

This post deals with the intricacies of Source Control in Team Foundation Server. A common operation is to do a ‘Rename’, particularly on a folder. So how does this affect the changesets for all files in that folder?

MoneyMaker

For this post, assume I have a product called ‘MoneyMaker’ in my TFS Project:

image1    image2

We are halfway through release 1.2.7 however the company has just come up with a new naming standard! We decide to check-in our last change to the service contract for safety, it was pretty much done anyway. It becomes changeset: 10081.

image3

Ok so now we have to perform a rename of the folder to match our new versioning strategy. The company wants to use letters instead of numbers for its convention. So the new version will be: A.B.G.

image4 image5

Ok so the rename was a success. Even the local folder has been updated. But I just realised I made a mistake with my last checking before the rename! I want to get an earlier version of that service contract. So let’s see what happens when I use the “get specific version” option on the file and specify the first changeset 10080.

image6  image7

Well, the ‘get’ seemed to do something, but we now have something funny happening:

image8

For some reason, the file now has a status of “Not Downloaded”. The file has even disappeared from the local file system:

image9

So what gives? Well believe it or not, this is completely by design. Think for a moment about that changeset 10080, the first changeset for the file. It existed when the folder name still reflected the old versioning strategy (v1.2.7). So that version of the file at that point in time belonged to a v1.2.7 folder, not a A.B.G folder. So Team Explorer did the right thing: it deleted the current copy, then went to download any relevant files for that folder (A.B.G), of which there were none. So what happens when we try to get that changeset from a level higher than renamed folder?

image10 image11

Well the ‘get’ happens as usual, but takes a little longer since it now has more files to process. But something interesting has now happened: the folder name has reverted back to the original! And the local file system reflects the same information:

image14  image15

Now you can get to the old versions of your files prior to the rename. But this is still a bit of a pain so be mindful of your renames. Have a think about the checkboxes in the ‘get specific version’ dialog to ensure that your ‘get’ doesn’t take all day.

Commenti

Attendere...
Il commento immesso è troppo lungo. Immetti un commento più breve.
Immissione non effettuata. Riprova.
Impossibile aggiungere il commento al momento. Riprova più tardi.
Per aggiungere un commento è necessaria l'autorizzazione di un genitore. Chiedi autorizzazione
I tuoi genitori hanno disattivato i commenti.
Impossibile eliminare il commento al momento. Riprova più tardi.
Hai raggiunto il numero massimo di commenti pubblicabili giornalmente. Riprova tra 24 ore.
Impossibile lasciare commenti. La funzionalità è stata disattivata perché i sistemi hanno rilevato una possibile attività di spamming dal tuo account. Se ritieni che il tuo account è stato disattivato per errore, contatta il supporto tecnico di Windows Live.
Esegui il seguente controllo di protezione per completare la pubblicazione del commento.
I caratteri digitati nel controllo di protezione devono corrispondere ai caratteri dell'immagine o della riproduzione audio.

Per aggiungere un commento, accedi con il tuo Windows Live ID (se utilizzi Hotmail, Messenger o Xbox LIVE possiedi già un Windows Live ID). Accedi


Non hai ancora un Windows Live ID? Registrati

Riferimenti (2)

L'URL di riferimento per questo intervento è:
http://stevennagy.spaces.live.com/blog/cns!B2EFDBF0964586B3!357.trak
Blog che fanno riferimento a questo intervento