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

rpcserver: use sets for roots and paths

Changeset 8c5993782d52

Parent 853cd0e75531

by Steve Borho

Changes to one file · Browse files at 8c5993782d52 Showing diff from parent 853cd0e75531 Diff from another changeset...

 
27
28
29
30
31
 
 
32
33
34
35
36
37
38
39
40
41
42
 
 
 
 
 
 
43
44
45
 
47
48
49
50
 
51
52
53
 
27
28
29
 
 
30
31
32
33
34
35
36
 
 
 
 
 
 
37
38
39
40
41
42
43
44
45
 
47
48
49
 
50
51
52
53
@@ -27,19 +27,19 @@
   def update_batch(batch):   '''updates thgstatus for all paths in batch''' - roots = [] - notifypaths = [] + roots = set() + notifypaths = set()   for path in batch:   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) and (r not in roots): - roots.append(r) - notifypaths.append(r) - elif r not in roots: - roots.append(r); - notifypaths.append(path) + if (r is not None): + roots.add(r) + notifypaths.add(r) + else: + roots.add(r); + notifypaths.add(path)   if roots:   _ui = ui.ui();   for r in sorted(roots): @@ -47,7 +47,7 @@
  print "updated repo %s" % r   if notifypaths:   time.sleep(2) - shlib.shell_notify(notifypaths) + shlib.shell_notify(list(notifypaths))   print "shell notified"    requests = Queue.Queue(0)