Show More
@@ -25,7 +25,8 b' def serve(ui, repo, **opts):' | |||
|
25 | 25 | class service(object): |
|
26 | 26 | def init(self): |
|
27 | 27 | try: |
|
28 |
self.master = server.master(ui, repo, |
|
|
28 | self.master = server.master(ui, repo.dirstate, | |
|
29 | repo.root, timeout) | |
|
29 | 30 | except server.AlreadyStartedException, inst: |
|
30 | 31 | raise util.Abort(str(inst)) |
|
31 | 32 |
@@ -29,12 +29,12 b' def start_server(function):' | |||
|
29 | 29 | if err[0] == errno.ECONNREFUSED: |
|
30 | 30 | self.ui.warn(_('(found dead inotify server socket; ' |
|
31 | 31 | 'removing it)\n')) |
|
32 |
os.unlink(s |
|
|
32 | os.unlink(os.path.join(self.root, '.hg', 'inotify.sock')) | |
|
33 | 33 | if err[0] in (errno.ECONNREFUSED, errno.ENOENT) and autostart: |
|
34 | 34 | self.ui.debug(_('(starting inotify server)\n')) |
|
35 | 35 | try: |
|
36 | 36 | try: |
|
37 |
server.start(self.ui, self. |
|
|
37 | server.start(self.ui, self.dirstate, self.root) | |
|
38 | 38 | except server.AlreadyStartedException, inst: |
|
39 | 39 | # another process may have started its own |
|
40 | 40 | # inotify server while this one was starting. |
@@ -64,11 +64,12 b' def start_server(function):' | |||
|
64 | 64 | class client(object): |
|
65 | 65 | def __init__(self, ui, repo): |
|
66 | 66 | self.ui = ui |
|
67 |
self.re |
|
|
67 | self.dirstate = repo.dirstate | |
|
68 | self.root = repo.root | |
|
68 | 69 | self.sock = socket.socket(socket.AF_UNIX) |
|
69 | 70 | |
|
70 | 71 | def _connect(self): |
|
71 |
sockpath = s |
|
|
72 | sockpath = os.path.join(self.root, '.hg', 'inotify.sock') | |
|
72 | 73 | try: |
|
73 | 74 | self.sock.connect(sockpath) |
|
74 | 75 | except socket.error, err: |
@@ -807,10 +807,10 b' class server(pollable):' | |||
|
807 | 807 | raise |
|
808 | 808 | |
|
809 | 809 | class master(object): |
|
810 |
def __init__(self, ui, |
|
|
810 | def __init__(self, ui, dirstate, root, timeout=None): | |
|
811 | 811 | self.ui = ui |
|
812 |
self.repowatcher = repowatcher(ui, |
|
|
813 |
self.server = server(ui, |
|
|
812 | self.repowatcher = repowatcher(ui, dirstate, root) | |
|
813 | self.server = server(ui, root, self.repowatcher, timeout) | |
|
814 | 814 | |
|
815 | 815 | def shutdown(self): |
|
816 | 816 | for obj in pollable.instances.itervalues(): |
@@ -823,7 +823,7 b' class master(object):' | |||
|
823 | 823 | sys.exit(0) |
|
824 | 824 | pollable.run() |
|
825 | 825 | |
|
826 |
def start(ui, |
|
|
826 | def start(ui, dirstate, root): | |
|
827 | 827 | def closefds(ignore): |
|
828 | 828 | # (from python bug #1177468) |
|
829 | 829 | # close all inherited file descriptors |
@@ -844,7 +844,7 b' def start(ui, repo):' | |||
|
844 | 844 | except OSError: |
|
845 | 845 | pass |
|
846 | 846 | |
|
847 |
m = master(ui, |
|
|
847 | m = master(ui, dirstate, root) | |
|
848 | 848 | sys.stdout.flush() |
|
849 | 849 | sys.stderr.flush() |
|
850 | 850 |
General Comments 0
You need to be logged in to leave comments.
Login now