views:

514

answers:

3

I'm using Visual Source Safe at a new job and it hasn't been too bad... then I renamed a file.

I clicked through the warning prompts not really paying attention realized that by renaming the file I lost all of my history. Is this really the case? I can't believe VSS doesn't support renaming.

I refactor lots of code and not having a renaming work properly really bites.


Thanks for the answers. I guess VSS does have renaming functionality, just not in Visual Studio. What a dealbreaker though, switching apps to rename a file in source control? :/

+1  A: 

VSS has a rename feature which maitains history File > Rename (I am positive that this maitains history) but its been a long time since I've used it

Rony
here is MSDN link which says this http://msdn.microsoft.com/en-us/library/efhkyswc(VS.80).aspx
Rony
But as I recall, it doesn't track the rename as a versioned change. The rename is retroactive through history. So if you check out an older tag, your file still has the new name (even though everything else still references the old name, like it did when you first checked it in). Which makes VSS history pretty much worthless in the face of renames.
Joe White
@Joe White: The rename is tracked in the parent folder's history. You _can_ get an older tag with the old filenames if you do a get of the tag from the parent folder itself. However, you are right about individual files: if you try to get the original version of a renamed file, SourceSafe will still use the new filename.
Mike Spross
+4  A: 

It's possible to do this in SourceSafe, but it requires a bit of manual intervention:

  1. First, make sure the file you want to rename is checked in.
  2. In SourceSafe, right-click the file and select Rename from the menu (or alternatively, simply press F2), then rename the file.
  3. This only renames the file within SourceSafe. You will have to check out the renamed file to your working folder and then delete the original file from your working copy to complete the rename.

If you view the file's history (right-click, then Show History, or altenatively, Ctrl-H), you will see that all of its history is intact. Note, however, that SourceSafe will refer to the file by its new name in all of the history entries for the file. The actual rename is tracked at the project folder level. If you view the history of the folder that contains the renamed file, you'll see a history item indicating that the file was renamed from oldname to newname.


Addendum: A note on retrieving older versions of renamed files from history

Joe White commented on this answer that SourceSafe doesn't honor the original filename when you do a Get on an older version of a renamed file. This is true, if you are getting the older version from the File History viewer.

However, if you do a Get of an older version of your code (before the rename) from the parent folder's history viewer, SourceSafe will correctly use the original filename when it puts the files in your working folder.

The reason for this behavior goes back to the fact that SourceSafe tracks renames at the parent folder level and not at the per-file level.

Mike Spross
+1  A: 

It doesn't matter.

Once you've seen your SourceSafe "database" corrupted through no action of your own, SS could produce daily rainbows and unicorns, but they'd eventually morph into festering sea creatures of random bytes, unrecoverable by man.

Get away from Source Safe. It was a noble effort by Microsoft to get people into the idea of source control, but I've twice (in 2 years, same data store, 3 people working against it) seen it die an unrecoverable death.

Get into svn, tfs, anything else! Tell your higher-ups that you're playing with fire every time you check in. You may be as lucky as I was on the project before the failed one, or you could just end up... relying on your backup strategy...

askheaves