check-code: catch Python 'is' comparing number or string literals
The Python 'is' operator compares object identity, so it should
definitely not be applied to string or number literals, which Python
implementations are free to represent with a temporary object.
This should catch the following kinds of bogus expressions (examples):
x is 'foo' x is not 'foo'
x is "bar" x is not "bar"
x is 42 x is not 42
x is -36 x is not -36
As originally proposed by Martin Geisler, amended with catching
negative numbers.
$ "$TESTDIR/hghave" inotify || exit 80
$ hg init
$ echo "[extensions]" >> $HGRCPATH
$ echo "inotify=" >> $HGRCPATH
inserve
$ hg inserve -d --pid-file=hg.pid
$ cat hg.pid >> "$DAEMON_PIDS"
let the daemon finish its stuff
$ sleep 1
empty
$ hg debuginotify
directories being watched:
/
.hg/
$ mkdir a
$ sleep 1
only 'a
$ hg debuginotify
directories being watched:
/
.hg/
a/
$ rmdir a
$ sleep 1
empty again
$ hg debuginotify
directories being watched:
/
.hg/
$ kill `cat hg.pid`