[英]hg diff two different files from a certain revision
I want to see the difference between filea
and fileb
as of rev1234, because fileb
appears to have been a fork-and-change-and-thereafter-run-two-versions-of-one-library, without a super informative commit message. 我想从
fileb
开始查看filea
和fileb
之间的区别,因为fileb
似乎是一个库的分叉和更改,然后运行两个版本,没有超级信息性的提交消息。
I tried hg diff -r 1234 filea fileb
, but that just shows me two diffs: 我尝试了
hg diff -r 1234 filea fileb
,但hg diff -r 1234 filea fileb
显示了两个差异:
filea
as of rev1234 and its current version, and filea
和当前版本之间的值,以及 fileb
as of rev1234 and its current version fileb
作为rev1234和当前版本 I want ONE diff, between filea
as of rev1234 and fileb
as of rev1234. 我想要一个差异,从rev1234开始的
filea
和从rev1234 fileb
的fileb之间。
I understand that both files are present in r1234? 我知道r1234中都存在这两个文件吗?
If r1234 is not your current working dir state, update your working directory to r1234 beforehand: hg update -r1234
Then you do not need any mercurial command but the normal diff command: diff fileA fileB
. 如果r1234不是当前的工作目录状态,请事先将工作目录更新为r1234:
hg update -r1234
然后,您不需要任何Mercurial命令,而需要常规的diff命令: diff fileA fileB
。 When you're done, hg up
again to return to normal. 完成后,再次
hg up
以恢复正常。
It's roundabout, but you can create a directory, export just those two files from that revision, and then compare them: 这是回旋处,但是您可以创建目录,仅从该修订版导出这两个文件,然后进行比较:
mkdir tempdiff
hg archive -r 1234 -I filea -I fileb tempdiff/
diff tempdiff/filea tempdiff/fileb
rm -r tempdiff
A one-command method would be nice, though. 但是,单命令方法会很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.