假设我有以下修改:
rev 1:
+ Dim Foo as integer
rev 2:
+ I like big butts, I cannot lie
rev 3
- Dim Foo as integer
Foo位于第 1 版和第 2 版中,并从第 3 版中删除。我可以发出什么命令来返回所有变更集Foo被添加或删除?
理想情况下,我也希望能够从 toroisehg 做到这一点
您可以使用grep http://www.selenic.com/mercurial/hg.1.html#grep命令 :
hg grep --all Foo
解决评论中 Lazy Badger 的担忧。
$ hg init
$ echo "Dim Foo as integer" > test
$ hg commit -m "1"
$ echo "I like big butts, I cannot lie" > test
$ hg commit -m "2"
$ echo "Dim Foo as integer" > test
$ hg commit -m "3"
$ hg grep --all Foo
grep 命令的输出是:
test:2:+:Dim Foo as integer
test:1:-:Dim Foo as integer
test:0:+:Dim Foo as integer
意思是,Foo
首次出现在版本 0 的文件测试中(+
标志告诉我们这一点),然后它在修订版 1 中消失了(-
标志),并在修订版 2 中再次出现。
我不知道这是否是你想要的,但它清楚地表明了搜索词被添加或删除的修订。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)