Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

rpcserver: implement update_thgstatus

Changeset e84282d581d7

Parent 87ec7c487d5e

by Adrian Buehlmann

Changes to one file · Browse files at e84282d581d7 Showing diff from parent 87ec7c487d5e Diff from another changeset...

 
5
6
7
8
 
9
10
11
 
28
29
30
31
 
 
 
 
 
32
33
34
 
91
92
93
94
95
96
97
98
99
100
101
102
103
104
 
105
106
107
108
109
110
 
 
 
 
 
 
 
 
 
 
111
112
113
 
5
6
7
 
8
9
10
11
 
28
29
30
 
31
32
33
34
35
36
37
38
 
95
96
97
 
 
 
 
 
 
 
 
 
 
 
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
@@ -5,7 +5,7 @@
 import _winreg  from mercurial import hg, cmdutil, util  from mercurial import repo as _repo -from thgutil import paths +from thgutil import paths, shlib  import sys  import win32serviceutil  import win32service @@ -28,7 +28,11 @@
   def update_thgstatus(path):   print "update thgstatus for path '%s'" % path - pass + root = paths.find_root(path) + if root is None: + return + shlib.update_thgstatus(ui.ui(), root, wait=False) + shlib.shell_notify([path])    class PipeServer:   def __init__(self): @@ -91,23 +95,23 @@
    if not data:   raise SystemExit # signal by dispatch terminate - - try: - update_thgstatus(data) - except SystemExit: - raise SystemExit # interrupted by thread2.terminate() - except: - import traceback - print "WARNING: something went wrong in get_hg_state()" - print traceback.format_exc() - status = "ERROR" - +   win32pipe.DisconnectNamedPipe(pipeHandle)   except win32file.error:   # Client disconnected without sending data   # or before reading the response.   # Thats OK - just get the next connection   continue + + try: + update_thgstatus(data) + except SystemExit: + raise SystemExit # interrupted by thread2.terminate() + except: + import traceback + print "WARNING: something went wrong in get_hg_state()" + print traceback.format_exc() + status = "ERROR"    if __name__ == '__main__':   import sys