2010-03-05 78 views
1

我试图让Mercurial的annotate命令处理包含模式指定的文件。当我运行下面的测试批处理文件,Mercurial annotate - 包括没有找到文件

hg annotate --include *.txt 

给了我以下错误:

abort: at least one filename or pattern is required 

正如你所看到的,我使用的是相同的模式将文件添加到回购,所以我不确定发生了什么事。

感谢任何帮助。

批处理文件:

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 

回答

2

--include *.txt是一种选择,但你仍然需要在最后一个文件的说法。试试这个

hg annotate --include `*.txt` . 

尾随时间段是非选项文件名。

此外,请确保引用* .txt部分,因为如果您在当前目录中有一个.txt文件,您的shell将会扩展它,并且该模式不会执行您想要的操作。

+0

这是....恼人的,但你是现货。谢谢 – 2010-03-05 03:58:45

+0

是的,当你想到在没有尾随模式的情况下--exclude是如何工作的时候,它会更有意义,但是错误信息很糟糕。 – 2010-03-05 04:14:10