解释TF差异 [英] Explaining tf diff

查看:107
本文介绍了解释TF差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Visual Studio 2008工具,



我试图获取更改集14318和14317的ASCII差异。



我可以使用GUI进行操作:

  tf更改集14318 

,然后选择一个文件,然后右键单击并选择与以前的版本进行比较。但是,这有点乏味并且基于GUI。我手头的任务是将许多更改回移植到另一个分支中。我想自动化测试(例如使用Python),以确保我正确地进行了测试。好吧,出于教育目的,我将手动进行所有更改,而无需查看解决方案,然后我将比较这两个更改并尝试查找任何差异。这是我对tf的最爱-我可以输入:

  tf changeset 14318> out.txt&&记事本out.txt 

查看受影响的文件的详细信息。 / p>

类似地,我希望得到一个out.txt,其中保存所有差异。我非常确定我可以处理Python部分。我当然想知道如何使用tf.exe工具来执行此操作,但是如果您还碰巧知道完成此操作的其他技巧(一些很酷的第三方工具或PowerShell脚本,请也告诉我)。



谢谢!



哦,顺便说一句,我检查了一下: http://msdn.microsoft.com/en-us/library/6fd7dc73(VS.80) .aspx



我尝试过:

  tf diff 14318 14317 

我得到了这个错误:File(或folder)c:\Program文件(x86)\Microsoft Visual Studio 9.0\VC\14318不存在。



现在谢谢。



编辑: 是否有任何工具可以做到这一点?

解决方案

在调用它时,您使用的语法不正确。在这种情况下,它尝试对(不存在的)文件 14318 14317的工作副本与基本存储库版本进行区分。



您需要做的是使用 / version 中的变更集范围,如下所示:

  tf diff $ / Foo / version:C14317〜C14318 /递归/ format:unified> foo.diff 

请注意,您可以使用,以及其他任何版本规范-标签,日期等。请参见此处以获得详细信息。


Using Visual Studio 2008 tools,

I am trying to get an ASCII diff of change sets 14318 and 14317.

I can do so using GUI:

tf changeset 14318

and then select a file and right-click and select compare with previous version. However, this is a bit tedious and it is GUI-based. My task at hand is to back-port many changes into a different branch. I would like to automate the testing (say using Python), making sure that I did it correctly. Well, for educational purposes I will make all changes by hand without looking at the solution, and then I will compare the two changes and try to look for any differences. Here is what I love about tf - I can type:

tf changeset 14318 > out.txt&&notepad out.txt

to view the details of what files were affected.

Similarly, I wish to get an out.txt with all the differences saved in it. I am pretty sure that I can handle the Python part. I definitely want to know how to do it using the tf.exe tool, but if you also happened to know other tricks for accomplishing this (some cool 3rd party tool, or PowerShell script, then please let me know as well).

Thank you!

Oh, by the way, I checked this: http://msdn.microsoft.com/en-us/library/6fd7dc73(VS.80).aspx

And I tried this:

tf diff 14318 14317

And I have gotten this error: File (or folder) c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\14318 does not exist.

Now thank you.

EDIT: Are there any tools at all that can do this?

解决方案

You're just not using the correct syntax when calling it. In this case, it tried to do a diff between your working copy, and the base repository version, of (non-existing) files 14318 and 14317.

What you need to do instead is to use a changeset range in /version, like this:

tf diff $/Foo /version:C14317~C14318 /recursive /format:unified > foo.diff

Note that you can use ~ with any other version specs - labels, dates etc. See here for details.

这篇关于解释TF差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆