[PATCH 7 of 7 v2] tests: add test-check-execute.t

timeless timeless at gmail.com
Mon Dec 28 12:26:41 CST 2015


Yuya Nishihara wrote:
>> +#require test-repo
>
> It needs execbit to be skipped on Windows.

I don't think so.

I tested w/ a FAT filesystem on OS X, and the set:exec() fileset
properly returned only files w/ +x from the repo, even though they all
appear to have +x according to ls.

>> +look for python scripts without the execute bit
>> +
>> +  $ hg files 'set:(**.py) and not exec()' 2> /dev/null | \
>> +  > xargs -n1 egrep -n -H '(env |/)python'|grep ':1:' | \
>> +  > cat
>
> You can use grep() fileset.

I can't. grep() doesn't give me line numbers.
I'm not asking "does this file have `env python`/`python`, I'm asking
"does the first line of this file have that" -- I'm doing that using
`-n` and :1: (the -H is to handle the case where there's only one
file).

Technically, a file could have " blah env python :1: " and that'd be a
false positive, but I'd rather cross that bridge if it ever
happens....


More information about the Mercurial-devel mailing list