简体   繁体   English

解决方案资源管理器以外的Visual Studio(具有TFS)历史记录?

[英]Visual Studio (with TFS) history other than solution explorer?

Has anyone ever found other ways to get a file's commit history outside of solution explorer? 有没有人找到其他方法来从解决方案资源管理器之外获取文件的提交历史记录? It's really annoying that history is so stagnant because it is a really helpful view. 历史如此停滞真是令人讨厌,因为它是一个很有帮助的观点。 I just wish it would show the current file. 我只希望它能显示当前文件。 Here is the use case. 这是用例。

I build my gigantic solution, find random errors in files I have never heard of and want to know who's at fault. 我建立了巨大的解决方案,在从未听说过的文件中发现随机错误,并想知道谁出了错。 I can get to the file by double clicking from the Error List view, but right clicking doesn't work, nor does navigating View->Other Windows->History. 我可以通过从“错误列表”视图中双击来获取文件,但是右键单击不起作用,也不能在“视图”->“其他Windows”->“历史记录”中导航。 If I can even get the history view, I just get the last history that I right-clicked from the Solution Explorer. 如果我什至可以获取历史记录视图,也只能获取在解决方案资源管理器中右键单击的最后一个历史记录。 +1 Also for anyone that has a way to find a file in the solution. +1也适用于任何有办法在解决方案中查找文件的人。

Double-click the error message to open the file. 双击错误消息以打开文件。 Then File > Source Control > Annotate to put a list of revisions down the left hand side. 然后,“文件”>“源代码控制”>“注释”将修订列表放到左侧。 You can then click a revision number to get the details. 然后,您可以单击修订号以获取详细信息。

I would grep the build log and pipe the output to the TFS powershell tools, but I'm a command line kind of guy. 我会复制构建日志并将输出通过管道传递到TFS powershell工具,但是我是命令行专家。 If you want to work inside VS, I don't think you can do any better than doubleclicking the row in the Errors toolwindow. 如果您想在VS中工作,我认为您没有比双击“错误”工具窗口中的行做得更好的了。 In addition to opening the file, this should automatically expand whatever projects & subfolders are needed so that the file is clickable in Solution Explorer (including rightclick -> History). 除了打开文件之外,这还将自动扩展所需的任何项目和子文件夹,以便在解决方案资源管理器中单击该文件(包括右键单击->历史记录)。

Quite aside from source control integration, here's the quickest way to open a file anywhere in the active solution: http://blogs.msdn.com/andrewarnottms/archive/2008/08/02/visual-studio-trick-to-quickly-find-any-file-in-solution.aspx 除了源代码控制集成之外,这是在活动解决方案中任何位置打开文件的最快方法: http : //blogs.msdn.com/andrewarnottms/archive/2008/08/02/visual-studio-trick-to-quickly -find-任何文件功能于solution.aspx

EDIT: here's a quick-n-dirty command line to look up the last 2 changes to every file with build errors. 编辑:这是一个快速n肮脏的命令行,以查找具有构建错误的每个文件的最后2个更改。

$regex = [regex] "(?<filename>\S+\.cs).*error"
msbuild | %{ $regex.Matches($_) } | %{ $_.groups["filename"].value } | select -unique | %{ tfhist $_ -stop 2 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM