我试图让mercurial的annotate命令处理include模式指定的文件。当我运行下面的测试批处理文件时,
hg annotate --include *.txt
给出以下错误:
abort: at least one filename or pattern is required
如您所见,我使用相同的模式将文件添加到repo中,所以我不确定发生了什么。
谢谢你的帮助。
批处理文件:
mkdir merc_test hg init merc_test cd merc_test echo "1" > 1.txt echo "2" > 2.txt hg add --include *.txt hg commit -m "checking in" hg annotate 1.txt hg annotate --include *.txt cd .. rmdir /s /q merc_test
这个 --include *.txt 是一个选项,但最后仍需要一个文件参数。试试这个
--include *.txt
hg annotate --include `*.txt` .
后面的句点是非选项文件名。
另外,请确保引用*.txt部分,因为如果在当前目录中有一个.txt文件,那么shell将展开它,而模式不会按您的要求执行。