** Description changed:
When in UDF mode, LR intercepts deletions, and as part of the process it
dirties the parent hashes... but the parent may not exist.
Patch proposed:
=== modified file 'ubuntuone/syncdaemon/local_rescan.py'
--- ubuntuone/syncdaemon/local_rescan.py 2011-04-05 19:33:06 +0000
+++ ubuntuone/syncdaemon/local_rescan.py 2011-07-08 21:00:52 +0000
@@ -672,8 +672,11 @@
fsm = self.fsm
for evtname, path in delete_events:
parentpath = os.path.dirname(path)
- log_info("UDF mode! Resetting hashes to dir %r", parentpath)
- self.fsm.set_by_path(parentpath, local_hash="",
server_hash="")
+ if self.fsm.has_metadata(path=parentpath):
+ log_info("UDF mode! Resetting hashes to dir %r",
+ parentpath)
+ self.fsm.set_by_path(parentpath,
+ local_hash="", server_hash="")
if evtname == "FS_DIR_DELETE":
log_info("UDF mode! Removing metadata from dir %r", path)
tree = fsm.get_paths_starting_with(path,
include_base=True)
---------
TEST CASE:
Run these commands to setup the tests:
mkdir ~/Ubuntu\ One/807737 ~/Ubuntu\ One/807737/a ~/Ubuntu\ One/807737/a/b
~/Ubuntu\ One/807737/aa
(Wait a minute for Ubuntu One to pickup these new folders)
u1sdtool -q
- rm -r ~/Ubuntu\ One/a
+ rm -r ~/Ubuntu\ One/807737a
u1sdtool -c
- Result: ~/Ubuntu\ One/a and ~/Ubuntu\ One/aa are deleted
+ Result: ~/Ubuntu\ One/807737/a and ~/Ubuntu\ One/807737/aa are deleted
- Expected result: Only ~/Ubuntu\ One/a is deleted
+ Expected result: Only ~/Ubuntu\ One/807737/a is deleted
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/807737
Title:
LR should not touch the hashes of non-existant MD
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntuone-client/+bug/807737/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs