Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Visual Source Safe really lack renaming functionality?

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? :/

like image 734
John Farrell Avatar asked Dec 18 '22 07:12

John Farrell


1 Answers

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.

like image 125
Mike Spross Avatar answered Apr 09 '23 05:04

Mike Spross