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

rpcserver: add def getrepos()

Changeset 8b622aae072c

Parent 436e13fe4fb5

by Adrian Buehlmann

Changes to one file · Browse files at 8b622aae072c Showing diff from parent 436e13fe4fb5 Diff from another changeset...

 
32
33
34
35
36
 
37
38
39
 
47
48
49
 
 
 
 
 
50
51
52
 
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
 
103
104
105
106
107
108
109
110
 
 
111
112
113
 
32
33
34
 
 
35
36
37
38
 
46
47
48
49
50
51
52
53
54
55
56
 
92
93
94
 
 
 
 
 
 
 
 
 
 
 
 
95
96
97
98
99
100
101
 
 
102
103
104
105
106
@@ -32,8 +32,7 @@
  ts = '[%s] ' % time.strftime('%c')   logq.put(ts + msg)   -def update_batch(batch): - '''updates thgstatus for all paths in batch''' +def getrepos(batch):   roots = set()   notifypaths = set()   for path in batch: @@ -47,6 +46,11 @@
  else:   roots.add(r);   notifypaths.add(path) + return roots, notifypaths + +def update_batch(batch): + '''updates thgstatus for all paths in batch''' + roots, notifypaths = getrepos(batch)   if roots:   _ui = ui.ui();   for r in sorted(roots): @@ -88,26 +92,15 @@
 def remove(args):   path = args[0]   logmsg('Removing ' + path) - roots = set() - notifypaths = set() - r = paths.find_root(path) - if r is None: - for n in os.listdir(path): - r = paths.find_root(os.path.join(path, n)) - if (r is not None): - roots.add(r) - notifypaths.add(r) - else: - roots.add(r); - notifypaths.add(path) + roots, notifypaths = getrepos([path])   if roots:   for r in sorted(roots):   try:   os.remove(os.path.join(r, '.hg', 'thgstatus'))   except OSError:   pass - if notifypaths: - shlib.shell_notify(list(notifypaths)) + if notifypaths: + shlib.shell_notify(list(notifypaths))    def dispatch(req, cmd, args):   if cmd == 'update':