如何查找已签出的文件

发布于 2024-07-24 11:36:31 字数 403 浏览 5 评论 0原文

我正在使用 Visual Source Safe 6.0d(工作要求),并且我一直在尝试编写一个小 shell 脚本,以允许我轻松删除源代码树,或者在我签出文件时警告我,以便我可以确保我不会不小心删除工作。 除了检查文件本身的只读位之外,还有什么方法可以判断文件是否已签出?

  1. VSS 似乎没有写入任何文件(我在签出文件之前和之后拍摄了目录的快照,列出的文件没有差异)
  2. 我似乎无法通过谷歌搜索找到任何内容。
  3. 我还检查了 vssver.scc 的差异,但没有发现任何东西。

请注意,检查可写文件并不是世界上最糟糕的事情,但似乎 VSS 使源树中的多个文件(*.ncb、*.scc、*.sln)可写,而我没有检查任何内容。 我可以简单地排除这些文件,但我正在尝试找到更优雅的解决方案。

I'm using Visual Source Safe 6.0d (work requirement) and I've been trying to hack together a little shell script to allow me to easily remove a source tree or warn me if I've got files checked out so I can make sure I don't accidentally delete work. Is there any way to tell if files are checked out other than checking the read-only bit on the files themselves?

  1. VSS doesn't seem to be writing any file (I took a snapshot of the dir before and after checking out a file and there was no difference in the files listed)
  2. I can't seem to find anything by Googling.
  3. I also checked the vssver.scc for differences and didn't find anything.

Mind you, checking for writeable files isn't the worst thing in the world but it seems as if VSS makes several files in the source tree (*.ncb, *.scc, *.sln) writeable without me having checked anything out. I can simply exclude the files but I'm trying to find a bit more elegant solution.

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

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

发布评论

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

评论(2

伴我心暖 2024-07-31 11:36:31

您可以使用 COM 检查文件是否已签出。 查看 IVSSItem.IsCheckedOut 属性。 有关通过 COM 使用 VSS 的更多信息,请参阅:

http:// /msdn.microsoft.com/en-us/library/4d44xhsd%28VS.80%29.aspx

You can use COM to check if a file is checked out. Take a look at the IVSSItem.IsCheckedOut property. For more on using VSS through COM see:

http://msdn.microsoft.com/en-us/library/4d44xhsd%28VS.80%29.aspx

﹏半生如梦愿梦如真 2024-07-31 11:36:31

也许最可靠的技术是询问 SourceSafe 本身签出了什么内容和/或是否签出了感兴趣的单个文件。 虽然我意识到如何在一个小 shell 脚本中执行此操作并不明显,但我建议使用 PowerShell 为此。

SourceSafe 公开了一个 OLE 自动化对象模型(也称为 COM 对象模型),并且 PowerShell 可以与 COM 对象通信。 如果您不熟悉这些东西,需要学习很多东西,但最终是值得的。

或者,如果 PowerShell 太陌生,也可以使用 VBScript 来控制 COM 对象。

Perhaps the most robust technique is to ask SourceSafe itself what is checked out and/or whether individual files of interest are checked out. Whilst I realize that it's not obvious how to do this in a little shell script, I'd advocate the use of PowerShell for this.

SourceSafe exposes an OLE Automation object model (also known as a COM object model), and PowerShell can talk to COM objects. If you're not familiar with this stuff, it's a lot to learn but ultimately it's worth it.

Alternatively, if PowerShell is too alien, VBScript can also be used to control COM objects.

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