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 new remove command

calling it on "Update Icons" context menu. This has the
benefit that first all directory icons are replaced
with question marks and then correct icons are appearing
slowly as repos are updated again. So the user has a
feedback how long it takes to update the icons on
directories.

Changeset 436e13fe4fb5

Parent a38a9c7d18fa

by Adrian Buehlmann

Changes to 3 files · Browse files at 436e13fe4fb5 Showing diff from parent a38a9c7d18fa Diff from another changeset...

 
85
86
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
89
90
 
 
91
92
93
 
85
86
87
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
114
115
116
117
118
119
@@ -85,9 +85,35 @@
  print msg % len(batch)   update_batch(batch)   +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) + 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)) +  def dispatch(req, cmd, args):   if cmd == 'update':   update(args) + elif cmd == 'remove': + remove(args)   else:   logmsg("Error: unknown request '%s'" % req)  
 
482
483
484
485
 
486
487
488
 
482
483
484
 
485
486
487
488
@@ -482,7 +482,7 @@
    if (cmd == "thgstatus")   { - Thgstatus::update(cwd); + Thgstatus::remove(cwd);   return;   }  
 
27
28
29
 
 
 
30
31
32
 
27
28
29
30
31
32
33
34
35
@@ -27,6 +27,9 @@
  static int update(const std::string& path) {   return SendRequest("update|" + path);   } + static int remove(const std::string& path) { + return SendRequest("remove|" + path); + }  };    #endif