Mercurial:差异文件
我实际上正在尝试一些简单的事情,但得到了奇怪的结果:
我想将文件的当前版本与特定修订版进行比较。
在NetBeans 6.9.1中我没有找到任何这样的函数。我只能调用历史记录,然后在连续修订之间进行比较。我错过了什么吗?
我尝试使用命令行工具(Linux): hg diff --rev 527 pom.xml
但我得到:
diff -r 1018d7890ea1 pom.xml
--- /dev/null 1970 年 1 月 1 日星期四 00:00:00 +0000
+++ b/pom.xml 2011 年 1 月 30 日星期日 22:45:28 +0000
@@ -0,0 +1,167 @@+
后仅跟“+”行。
我怎样才能得到我想要的差异?如何使用 NetBeans(或其他图形差异工具)获取此差异?
I'm actually trying something simple, but I get strange results:
I want to compare the current version of a file with a specific revision.
In NetBeans 6.9.1 I didn't find any such function. I can only call the history and then diff between successive revisions. Am I missing something?
I tried with the command line tool (Linux):
hg diff --rev 527 pom.xml
But I get:
diff -r 1018d7890ea1 pom.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pom.xml Sun Jan 30 22:45:28 2011 +0000
@@ -0,0 +1,167 @@+
followed only by "+" lines.
How can I get the diff I want? How can I get this diff with NetBeans (or otherwise with another graphical diff tool)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您对命令行工具的使用看起来是正确的。但是,输出
表明您要比较的文件在您选择的修订版中尚不存在。
附录:
在评论中您提到文件已重命名并且需要使用 -g
您可以通过添加以下内容来为所有差异启用 -g:
到您的
.hgrc
文件(通常位于您的主目录中)You usage of the command-line tool looks correct. However the output
Indicates that the file you want to diff did not yet exist in the revision you chose.
Addendum:
In the comments you mention the file was renamed and you need to use -g
You can enable -g for all diffs by adding:
to your
.hgrc
file (usually located in your home directory)其中 revision1 和 revision2 可以是标签、变更集等。
默认情况下,如果您想将修订版与当前修订版进行比较,您的 revision2 应该是“tip”(不带引号)。
Where revision1 and revision2 can be a tag, changeset etc.
By default, your revision2 should be "tip" (without quotes) if you want to compare a revision to the current one.