# HG changeset patch # User Benoit Boissinot # Date 2008-09-07 13:10:11 # Node ID ee308d44ad765ffe1ff3f6cc49af262e0609351f # Parent 9c4e488f105ec666731090a53b35a23ba2816b68 inotify: add client code for long pathname handling diff --git a/hgext/inotify/client.py b/hgext/inotify/client.py --- a/hgext/inotify/client.py +++ b/hgext/inotify/client.py @@ -14,7 +14,14 @@ import os, select, socket, stat, struct, def query(ui, repo, names, match, list_ignored, list_clean, list_unknown=True): sock = socket.socket(socket.AF_UNIX) sockpath = repo.join('inotify.sock') - sock.connect(sockpath) + try: + sock.connect(sockpath) + except socket.error, err: + if err[0] == "AF_UNIX path too long": + sockpath = os.readlink(sockpath) + sock.connect(sockpath) + else: + raise def genquery(): for n in names or []: diff --git a/tests/test-inotify-issue1208.out b/tests/test-inotify-issue1208.out --- a/tests/test-inotify-issue1208.out +++ b/tests/test-inotify-issue1208.out @@ -1,9 +1,7 @@ % fail -failed to contact inotify server: AF_UNIX path too long +failed to contact inotify server: No such file or directory deactivating inotify abort: could not start server: File exists % inserve % status -failed to contact inotify server: AF_UNIX path too long -deactivating inotify ? hg.pid