mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 09:48:05 +03:00
afb08fe68c
When path is too long to be an Unix socket address, we create a socket in a temporary directory and link from the long path to the shorter one. But checks in server code at startup were insufficient in this case, and used to raise an unclear "tried linking .hg/inotify.sock to a temporary socket but .hg/inotify.sock already exists"
37 lines
923 B
Perl
37 lines
923 B
Perl
|
|
$ "$TESTDIR/hghave" inotify || exit 80
|
|
$ echo "[extensions]" >> $HGRCPATH
|
|
$ echo "inotify=" >> $HGRCPATH
|
|
$ p="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
$ hg init $p
|
|
$ cd $p
|
|
|
|
fail
|
|
|
|
$ ln -sf doesnotexist .hg/inotify.sock
|
|
$ hg st
|
|
abort: inotify-server: cannot start: .hg/inotify.sock is a broken symlink
|
|
inotify-client: could not start inotify server: child process failed to start
|
|
$ hg inserve
|
|
abort: inotify-server: cannot start: .hg/inotify.sock is a broken symlink
|
|
[255]
|
|
$ rm .hg/inotify.sock
|
|
|
|
inserve
|
|
|
|
$ hg inserve -d --pid-file=hg.pid
|
|
$ cat hg.pid >> "$DAEMON_PIDS"
|
|
|
|
status
|
|
|
|
$ hg status
|
|
? hg.pid
|
|
|
|
if we try to start twice the server, make sure we get a correct error
|
|
|
|
$ hg inserve -d --pid-file=hg2.pid
|
|
abort: inotify-server: cannot start: socket is already bound
|
|
abort: child process failed to start
|
|
[255]
|
|
$ kill `cat hg.pid`
|