我一直在使用 SourceGear Vault 进行一些个人项目,并使用 Team Foundation Server 进行工作项目。 TFS 缺少的一件事是 Vault 在其签入对话框窗口中具有的一项简单功能。
在 Vault 客户端中,您可以查看签出的文件与签入的先前版本相比是否发生更改。这是 屏幕截图。注意到“详细信息”栏了吗?这告诉你有区别。如果您必须检查整个项目,因为您要重新生成代码,那么这是非常有用的。我将检查我的类库项目,然后重新生成我的 CodeSmith 模板。这样做可能会导致仅更改一些特定文件。当我查看待签入屏幕时,我会看到真正更改的文件,并且可以进行比较以查看影响。
那么... TFS 可以做到这一点吗?也许有一个第三方工具可以帮我做到这一点?是否有我必须获得的 TFS SDK 或 PowerTool。有人想建造它吗?
I have been using SourceGear vault for some personal projects and Team Foundation Server for work projects. One thing TFS is missing is a simple feature that Vault has on its check in dialog window.
In the Vault client, you can see if the checked out file changed from the previous version checked in. Here is a screen shot. Notice the column "Details"? That tells you there is a difference. The way this is super helpful is if you have to check out a entire project because you are going to do code re-generation. I'll check out my class library project and then regenerate my CodeSmith templates. Doing this may result in just a few specific files from changing. When I view the pending check-in screen, I see the files that really changed and I can compare to see the impact.
SO... can TFS do this? Maybe there is a 3rd-party tool that will do it for me? Is there a TFS SDK or PowerTool that I have to get. Anyone want to build it?
发布评论
评论(5)
选择“待更改”窗口中的所有文件并激活上下文菜单。然后点击“撤消...”> “撤消更改” > “对所有人说不”。
未更改的文件将被回滚。
Select all the files in "Pending changes" window and activate the context menu. Then click "Undo..." > "Undo Changes" > "No to All".
The files without changes will be rolled back.
根据此页面,您可以从 Visual Studio 命令提示符运行此命令。
您需要安装 TFS Power Tools 才能正常工作。另外,请确保在命令提示符下浏览到映射文件夹的根目录(例如 - C:\TFS)。
TFS Power Tools 链接(如果您还没有)
2010 年 TFS 强力工具
2012 年 TFS 电动工具
Per this page, you can run this command from the Visual Studio Command Prompt.
You'll need to have TFS Power Tools installed for this to work. Also, make sure you browse to the root of your mapped folder within the command prompt (ie - C:\TFS for example).
TFS Power Tools links (if you don't already have it)
TFS Power Tools for 2010
TFS Power Tools for 2012
无需撤消未更改的文件,因为 TFS 会在签入时注意到它们未更改,并且只会关联真正更改的文件。任何签出但未更改的文件都将恢复到其最后已知的签入版本,并且不会与您的签入相关联。在 TFS 中(尽管没有非常清楚地记录)不可能签入未更改的文件。如果没有更改,它将始终恢复到以前的版本。
您可以通过调用 'tfpt.exe uu /r' 从命令行(您需要有 Team Foundation Power 工具来执行此操作)或使用“待处理更改”窗口中的“撤消未更改”按钮。这会立即从列表中删除所有未更改的项目。这样您就可以准确地看到您正在签入的内容。
尽管此选项可能是由Team Foundation Power Tools 或 TFS 源代码管理资源管理器扩展(无论如何,每个 TFS 用户都必须拥有) 。
另请参阅:
There is no need to undo the unchanged files, as TFS will notice they're unchanged upon checkin and will only associate the truly changed files. Any files checked out but unchanged are reverted to their last known checked in version and will not be associated with your checkin. It is impossible in TFS (though not very clearly documented) to check in an unchanged file. It will always revert to the previous version if there are no changes.
You can quickly undo your unchanged files by calling 'tfpt.exe uu /r' from the command line (you need to have the Team Foundation Power tools for this) or by using the "Undo unchanged" button in the Pending changes window. This removed any items from the list that are unchanged immediately. So that you can see exactly what you're checking in.
Though it might be that this option is added by the Team Foundation Power Tools or the TFS Source Control Explorer Extensions (which are a must have for every TFS user anyways).
See also:
我不喜欢回答自己的问题,但看起来可能没有真正的 Microsoft 解决方案。对我来说,这就是我在办公室使用 Visual Studio 处理问题的方法。
这非常耗时。我从来没有认为这是一个问题,直到我看到 Vault 识别出磁盘上的文件与存储库中的文件不同。
也许你们都可以说出在使用源代码控制存储库时如何进行代码生成/重新生成。
I don't like answering my own questions, but it looks like there might not be a real Microsoft solution out there. For me, this is how I handle the problem at the office using Visual Studio.
This is pretty time consuming. I never thought of it as a problem until I saw Vault identifying that a file was different on disk from the repository.
Maybe you all can say how you do code generation / regeneration when working with a source control repository.
我在企业开发环境中工作,许多开发人员可能正在处理同一个文件,并且我们也使用 TFS 作为源代码控制。在我们的 TFS 最佳实践文档中,我们确实不鼓励检查开发人员不打算更改的文件,这样我们在提交变更集时自然会排除没有差异的文件。
为了回答您的问题,我通常只是查看“待处理的更改”窗口,并对我不确定的“已更改”文件运行比较 - 比较工具应该立即告诉您是否本地副本与服务器副本相同。不幸的是,除了我建议的之外,没有真正的解决方法,但我没有看到我绝对必须签出整个项目分支进行编辑的情况。
I work in a corporate development environment where many developers may be working on the same file, and we have TFS as our source control as well. In our document of Best Practices for TFS, we really discourage checking out files that the developers don't intend on changing, that way we naturally exclude files without differences when submitting a changeset.
To answer your question, I normally just look at the "Pending Changes" window and run a Compare on the "changed" files that I'm unsure of--the Compare tool should immediately tell you if your local copy is the same as the server copy. Unfortunately, there's no real workaround other than what I suggested, but I don't see the scenario where I absolutely must check out an entire project branch for editing.