Visual Source Safe 真的缺乏重命名功能吗?

发布于 2024-07-25 09:34:59 字数 273 浏览 2 评论 0原文

我在新工作中使用 Visual Source Safe,效果还不错……然后我重命名了一个文件。

我点击了警告提示,但没有真正注意到,通过重命名文件,我丢失了所有历史记录。 事实真的如此吗? 我不敢相信 VSS 不支持重命名。

我重构了很多代码,但没有正确地进行重命名确实很痛苦。


感谢您的回答。 我想 VSS 确实有重命名功能,只是 Visual Studio 中没有。 不过,切换应用程序来重命名源代码管理中的文件是多么大的破坏啊? :/

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

墨落成白 2024-08-01 09:34:59

可以在 SourceSafe 中执行此操作,但需要一些手动干预:

  1. 首先,确保您要重命名的文件已签入。
  2. 在 SourceSafe 中,右键单击该文件并选择重命名菜单(或者只需按 F2),然后重命名该文件。
  3. 这只会重命名 SourceSafe 中的文件。 您必须将重命名的文件签出到工作文件夹,然后从工作副本中删除原始文件才能完成重命名。

如果您查看文件的历史记录(右键单击,然后显示历史记录,或者Ctrl-H),您将看到其所有历史记录都完好无损。 但请注意,SourceSafe 将在该文件的所有历史条目中通过新名称引用该文件。 实际的重命名是在项目文件夹级别进行跟踪的。 如果您查看包含重命名文件的文件夹的历史记录,您将看到一个历史记录项,指示该文件已从 oldname 重命名为 newname


附录:关于从历史记录中检索重命名文件的旧版本的说明

Joe White 评论了 这个答案表明,当您对旧版本的重命名文件执行 Get 时,SourceSafe 不会遵循原始文件名。 如果您从文件历史记录查看器获取旧版本,则确实如此。

但是,如果您从父文件夹的历史查看器中获取旧版本的代码(重命名之前),SourceSafe 将在以下情况下正确使用原始文件名:它将文件放入您的工作文件夹中。

出现此行为的原因可以追溯到 SourceSafe 在父文件夹级别而不是每个文件级别跟踪重命名的事实。

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.

自演自醉 2024-08-01 09:34:59

没关系。

一旦你看到你的 SourceSafe“数据库”由于你自己没有采取任何行动而被损坏,SS 就可以每天产生彩虹和独角兽,但它们最终会变成随机字节的溃烂海洋生物,人类无法恢复。

远离源安全。 微软为让人们了解源代码控制的想法做出了崇高的努力,但我已经两次(在 2 年内,同一个数据存储,3 个人反对它)看到它无可挽回的死亡。

进入 svn、tfs,或者其他任何东西! 告诉你的上级,你每次签到时都是在玩火。你可能会像我在失败之前的项目中一样幸运,或者你可能最终......依靠你的备份策略...... 。

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...

染火枫林 2024-08-01 09:34:59

VSS 具有保留历史记录的重命名功能
文件> 重命名(我确信这会保留历史)
但我已经很久没有使用它了

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文