Changeset 436e13fe4fb5…
Parent a38a9c7d18fa…
by
Changes to 3 files · Browse files at 436e13fe4fb5 Showing diff from parent a38a9c7d18fa Diff from another changeset...
@@ -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,7 +482,7 @@
if (cmd == "thgstatus")
{
- Thgstatus::update(cwd);
+ Thgstatus::remove(cwd);
return;
}
|
@@ -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
|
Loading...