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

timeless timeless at gmail.com
Tue Dec 29 21:50:36 CST 2015


On Tue, Dec 29, 2015 at 9:31 PM, Yuya Nishihara <yuya at tcha.org> wrote:
>> 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.
>
> That only applies to committed files. If you add a new file on FAT, it can't
> be marked as an executable.

> That said, do you think Windows people should be blamed if they add an
> executable with no executable bit? If so, no "#require execbit" would make
> sense.

To be honest, I consider this a bug in hg. I should be able to set the
execute information while using a fat file system. It's just metadata.
And we can clearly record and report it.

That said, I guess I'm ok w/ doing a require execbit for now...

>> >> +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).
>
> grep() uses re.search(), in which MULTILINE is off by default. "^" only
> matches the first line. You can also use "\A".
>
> https://docs.python.org/2.7/library/re.html
>
> FWIW, '(env |/)python' doesn't work on Windows because of "/".

ok. Unqueue this and I'll revisit it...


More information about the Mercurial-devel mailing list