tags:

views:

195

answers:

1

Hi, 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
+1  A: 

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.

Ry4an
That's.... annoying, but you're spot on. Thanks
Ben Hughes
Yeah, it makes more sense when you think of how a --exclude would work in the absence of a trailing pattern, but the error message sucks.
Ry4an