##// END OF EJS Templates
inotify: deactivate inotify status on failure...
Benoit Boissinot -
r6996:fecf060f default
parent child Browse files
Show More
@@ -0,0 +1,15 b''
1 #!/bin/sh
2
3 "$TESTDIR/hghave" inotify || exit 80
4
5 echo "[extensions]" >> $HGRCPATH
6 echo "inotify=" >> $HGRCPATH
7
8 p="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
9 hg init $p
10 cd $p
11
12 echo % inserve
13 hg inserve
14 echo % status
15 hg status
@@ -0,0 +1,5 b''
1 % inserve
2 abort: AF_UNIX path too long
3 % status
4 failed to contact inotify server: AF_UNIX path too long
5 deactivating inotify
@@ -63,9 +63,8 b' def reposetup(ui, repo):'
63 ui.warn(_('(found dead inotify server socket; '
63 ui.warn(_('(found dead inotify server socket; '
64 'removing it)\n'))
64 'removing it)\n'))
65 os.unlink(repo.join('inotify.sock'))
65 os.unlink(repo.join('inotify.sock'))
66 elif err[0] != errno.ENOENT:
66 if err[0] in (errno.ECONNREFUSED, errno.ENOENT) and \
67 raise
67 ui.configbool('inotify', 'autostart'):
68 if ui.configbool('inotify', 'autostart'):
69 query = None
68 query = None
70 ui.debug(_('(starting inotify server)\n'))
69 ui.debug(_('(starting inotify server)\n'))
71 try:
70 try:
@@ -79,16 +78,20 b' def reposetup(ui, repo):'
79 except Exception, inst:
78 except Exception, inst:
80 ui.warn(_('could not start inotify server: '
79 ui.warn(_('could not start inotify server: '
81 '%s\n') % inst)
80 '%s\n') % inst)
82 ui.print_exc()
83
84 if query:
81 if query:
85 try:
82 try:
86 return query(ui, repo, files or [], match,
83 return query(ui, repo, files or [], match,
87 list_ignored, list_clean, list_unknown)
84 list_ignored, list_clean, list_unknown)
88 except socket.error, err:
85 except socket.error, err:
89 ui.warn(_('could not talk to new inotify '
86 ui.warn(_('could not talk to new inotify '
90 'server: %s\n') % err[1])
87 'server: %s\n') % err[-1])
91 ui.print_exc()
88 else:
89 ui.warn(_('failed to contact inotify server: %s\n')
90 % err[-1])
91 ui.print_exc()
92 # replace by old status function
93 ui.warn(_('deactivating inotify\n'))
94 self.status = super(inotifydirstate, self).status
92
95
93 return super(inotifydirstate, self).status(
96 return super(inotifydirstate, self).status(
94 files, match or util.always, list_ignored, list_clean,
97 files, match or util.always, list_ignored, list_clean,
@@ -57,6 +57,13 b' def has_executablebit():'
57 finally:
57 finally:
58 os.remove(path)
58 os.remove(path)
59
59
60 def has_inotify():
61 try:
62 import hgext.inotify.linux.watcher
63 return True
64 except ImportError:
65 return False
66
60 def has_fifo():
67 def has_fifo():
61 return hasattr(os, "mkfifo")
68 return hasattr(os, "mkfifo")
62
69
@@ -129,14 +136,15 b' checks = {'
129 "fifo": (has_fifo, "named pipes"),
136 "fifo": (has_fifo, "named pipes"),
130 "git": (has_git, "git command line client"),
137 "git": (has_git, "git command line client"),
131 "hotshot": (has_hotshot, "python hotshot module"),
138 "hotshot": (has_hotshot, "python hotshot module"),
139 "inotify": (has_inotify, "inotify extension support"),
132 "lsprof": (has_lsprof, "python lsprof module"),
140 "lsprof": (has_lsprof, "python lsprof module"),
133 "mtn": (has_mtn, "monotone client (> 0.31)"),
141 "mtn": (has_mtn, "monotone client (> 0.31)"),
142 "pygments": (has_pygments, "Pygments source highlighting library"),
134 "svn": (has_svn, "subversion client and admin tools"),
143 "svn": (has_svn, "subversion client and admin tools"),
135 "svn-bindings": (has_svn_bindings, "subversion python bindings"),
144 "svn-bindings": (has_svn_bindings, "subversion python bindings"),
136 "symlink": (has_symlink, "symbolic links"),
145 "symlink": (has_symlink, "symbolic links"),
137 "tla": (has_tla, "GNU Arch tla client"),
146 "tla": (has_tla, "GNU Arch tla client"),
138 "unix-permissions": (has_unix_permissions, "unix-style permissions"),
147 "unix-permissions": (has_unix_permissions, "unix-style permissions"),
139 "pygments": (has_pygments, "Pygments source highlighting library"),
140 }
148 }
141
149
142 def list_features():
150 def list_features():
General Comments 0
You need to be logged in to leave comments. Login now