开发者

Mercurial annotate --include not finding files

I'm trying to to get Mercurial's annotate command to work on files specifed by an include pattern. When I run the test batch file below,

hg annotate --include *.txt

gives me the following error:

abort: at least one filename or pattern is required

As you can see, I'm开发者_如何学编程 using the same pattern to add the files to the repo, so I'm not sure what's going on.

Appreciate any help.

Batch file:

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


the --include *.txt is an option, but you still need a file argument at the end. Try this

hg annotate --include `*.txt` .

That trailing period is the non-option filename.

Also, make sure to quote the *.txt part because if you have a .txt file in your current dir your shell will expand it and the pattern won't do what you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜