Mercurial-确定删除文件的位置? [英] Mercurial - determine where file was removed?
问题描述
如果执行hg log myfile -v
,您会看到文件被修改的变更集列表.
If you do hg log myfile -v
you see a list of changesets that the file was modified in.
在我们的情况下,在最近的变更集中,该文件已被删除.但是您不能通过查看hg log的详细(-v)输出来分辨这一点.您可以使用简单的Mercurial命令来确定是否以及何时从存储库中删除文件吗?
In our case, in the most recent changeset, the file was removed. But you can't tell this by looking at the verbose (-v) output of hg log. Is there an easy Mercurial command you can use to determine if and when a file has been removed from the repo?
更新:请注意,这是在Windows客户端上,我们正在使用Mercurial v 1.4.3
Update: Note that this is on a Windows client, and we are using Mercurial v 1.4.3
更新2 :似乎下面的答案适用于最新版本的Mercurial,但是目前尚无法进行升级. v 1.4.3的其他任何想法
Update 2: Appears the answers below would work with a more recent version of Mercurial, however an upgrade isn't in the cards right now. Any other ideas for v 1.4.3 ???
推荐答案
您可以使用修订集检查哪个修订删除了文件(其他许多有趣的功能):
You can check which revision deleted a file (any many other interesting features) using revsets:
hg log -r 'removes(<myfile>)'
一些例子:
hg log -r 'removes(build.xml)'
//以前的build.xml位于当前目录中
hg log -r 'removes(build.xml)'
// where build.xml used to be in the current directory
hg log -r 'removes("**/build.xml")'
//build.xml可能位于子目录中
hg log -r 'removes("**/build.xml")'
// where build.xml may have been in sub directories
有关详细信息,请参见 hg help revsets
.
See hg help revsets
for details.
这篇关于Mercurial-确定删除文件的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!