Merge lp:~verterok/ubuntuone-client/fix-452682-stable into lp:ubuntuone-client

Proposed by Guillermo Gonzalez
Status: Rejected
Rejected by: Guillermo Gonzalez
Proposed branch: lp:~verterok/ubuntuone-client/fix-452682-stable
Merge into: lp:ubuntuone-client
Diff against target: 92 lines (+42/-0) (has conflicts)
3 files modified
tests/syncdaemon/test_sync.py (+25/-0)
tests/syncdaemon/test_vm.py (+13/-0)
ubuntuone/syncdaemon/volume_manager.py (+4/-0)
Text conflict in tests/syncdaemon/test_sync.py
Contents conflict in ubuntuone/syncdaemon/u1fsfsm.ods
To merge this branch: bzr merge lp:~verterok/ubuntuone-client/fix-452682-stable
Reviewer Review Type Date Requested Status
Roman Yepishev (community) Needs Fixing
Joshua Hoover (community) ran branch and verified fix Approve
Review via email: mp+25558@code.launchpad.net

Commit message

Fix 'Shared With Me' symlink if the target was changed and the link is broken.

Description of the change

Fix 'Shared With Me' symlink if the target was changed and the link is broken.

To post a comment you must log in.
Revision history for this message
Joshua Hoover (joshuahoover) wrote :

Passed test in bug #452682.

review: Approve (ran branch and verified fix)
Revision history for this message
Roman Yepishev (rye) wrote :

Patched local stable install and tested it - works fine.

review: Approve
Revision history for this message
Roman Yepishev (rye) wrote :

But I believe the branch should be updated first to get rid of conflicts

review: Needs Fixing
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Hi Roman, I made a mistake while doing the merge proposal, the branch should target stable-1-2 instead of trunk, I'll submit a new merge proposal

Thanks!

Unmerged revisions

509. By Guillermo Gonzalez

check if the symlink target is the shares dir instead if it exists.

508. By Guillermo Gonzalez

fix 'Shared With Me' symlink if the target is deleted/changed and is broken.

507. By Facundo Batista

Support FS_FILE_CREATE while having the file in LOCAL.

506. By dobey

[backport] r508
Use the correct MODAL flag to avoid AttributeError
Use a try/finally to destroy the dialog when closed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/ubuntuone-preferences'
=== modified file 'tests/syncdaemon/test_sync.py'
--- tests/syncdaemon/test_sync.py 2010-05-11 20:40:47 +0000
+++ tests/syncdaemon/test_sync.py 2010-05-18 19:48:27 +0000
@@ -268,6 +268,7 @@
268 sync.handle_AQ_DOWNLOAD_DOES_NOT_EXIST(**kwargs)268 sync.handle_AQ_DOWNLOAD_DOES_NOT_EXIST(**kwargs)
269 self.assertTrue(self.called, 'nothing was called')269 self.assertTrue(self.called, 'nothing was called')
270270
271<<<<<<< TREE
271 def test_handle_FILE_CREATE_while_LOCAL(self):272 def test_handle_FILE_CREATE_while_LOCAL(self):
272 """A FS_FILE_CREATE is received with the node in LOCAL."""273 """A FS_FILE_CREATE is received with the node in LOCAL."""
273 sync = Sync(main=self.main)274 sync = Sync(main=self.main)
@@ -315,6 +316,30 @@
315316
316317
317class SyncStateMachineRunnerTestCase(BaseSync):318class SyncStateMachineRunnerTestCase(BaseSync):
319=======
320 def test_handle_FILE_CREATE_while_LOCAL(self):
321 """A FS_FILE_CREATE is received with the node in LOCAL."""
322 sync = Sync(main=self.main)
323 self.called = False
324
325 def faked_nothing(ssmr, event, params, *args):
326 """Wrap SSMR.nothing to test."""
327 self.called = True
328 SyncStateMachineRunner.nothing = faked_nothing
329
330 # create a file and put it in local
331 fsm = self.main.fs
332 somepath = os.path.join(self.root, 'somepath')
333 mdid = fsm.create(somepath, '')
334 fsm.set_by_mdid(mdid, local_hash='somehash')
335
336 # send the event, and check that it called its .nothing()
337 sync.handle_FS_FILE_CREATE(somepath)
338 self.assertTrue(self.called)
339
340
341class SyncStateMachineRunnerTestCase(BaseTwistedTestCase):
342>>>>>>> MERGE-SOURCE
318 """Tests for the SyncStateMachineRunner."""343 """Tests for the SyncStateMachineRunner."""
319344
320 def setUp(self):345 def setUp(self):
321346
=== modified file 'tests/syncdaemon/test_vm.py'
--- tests/syncdaemon/test_vm.py 2010-04-07 13:56:56 +0000
+++ tests/syncdaemon/test_vm.py 2010-05-18 19:48:27 +0000
@@ -1759,6 +1759,7 @@
1759 self.assertEquals(result[0], udf_path)1759 self.assertEquals(result[0], udf_path)
1760 self.assertEquals(result[1], "UDFs can not be a symlink")1760 self.assertEquals(result[1], "UDFs can not be a symlink")
17611761
1762
1762class MetadataTestCase(BaseTwistedTestCase):1763class MetadataTestCase(BaseTwistedTestCase):
1763 md_version_None = False1764 md_version_None = False
1764 main = None1765 main = None
@@ -2649,6 +2650,18 @@
2649 self.assertTrue(isinstance(share, _Share))2650 self.assertTrue(isinstance(share, _Share))
2650 self.assertTrue(isinstance(old_share, _Share))2651 self.assertTrue(isinstance(old_share, _Share))
26512652
2653 def test_broken_symlink_latest_metadata(self):
2654 """Test vm startup with latest metadata and a broken symlink."""
2655 self._build_layout_version_4()
2656 os.unlink(self.shares_dir_link)
2657 # create a broken link
2658 os.symlink('foo', self.shares_dir_link)
2659 # we want to keep a refernece to main in order to shutdown
2660 # pylint: disable-msg=W0201
2661 self.main = FakeMain(self.root_dir, self.shares_dir,
2662 self.data_dir, self.partials_dir)
2663 self.check_version()
2664
26522665
2653class BrokenOldMDVersionUpgradeTests(MetadataOldLayoutTests):2666class BrokenOldMDVersionUpgradeTests(MetadataOldLayoutTests):
2654 """MetadataOldLayoutTests with broken .version file."""2667 """MetadataOldLayoutTests with broken .version file."""
26552668
=== renamed file 'ubuntuone/syncdaemon/u1fsfsm.ods' => 'ubuntuone/syncdaemon/u1fsfsm.ods.OTHER'
2656Binary files ubuntuone/syncdaemon/u1fsfsm.ods 2010-05-06 18:07:50 +0000 and ubuntuone/syncdaemon/u1fsfsm.ods.OTHER 2010-05-18 19:48:27 +0000 differ2669Binary files ubuntuone/syncdaemon/u1fsfsm.ods 2010-05-06 18:07:50 +0000 and ubuntuone/syncdaemon/u1fsfsm.ods.OTHER 2010-05-18 19:48:27 +0000 differ
=== modified file 'ubuntuone/syncdaemon/u1fsfsm.py'
=== modified file 'ubuntuone/syncdaemon/volume_manager.py'
--- ubuntuone/syncdaemon/volume_manager.py 2010-04-07 13:56:56 +0000
+++ ubuntuone/syncdaemon/volume_manager.py 2010-05-18 19:48:27 +0000
@@ -309,6 +309,10 @@
309 if not os.path.exists(self.m.shares_dir_link):309 if not os.path.exists(self.m.shares_dir_link):
310 self.log.debug('creating Shares symlink: %r -> %r',310 self.log.debug('creating Shares symlink: %r -> %r',
311 self.m.shares_dir_link, self.m.shares_dir)311 self.m.shares_dir_link, self.m.shares_dir)
312 # remove the symlink if it's broken
313 if os.path.islink(self.m.shares_dir_link) and \
314 not os.path.exists(os.readlink(self.m.shares_dir_link)):
315 os.remove(self.m.shares_dir_link)
312 os.symlink(self.m.shares_dir, self.m.shares_dir_link)316 os.symlink(self.m.shares_dir, self.m.shares_dir_link)
313 # make the shares_dir read only317 # make the shares_dir read only
314 os.chmod(self.m.shares_dir, 0555)318 os.chmod(self.m.shares_dir, 0555)

Subscribers

People subscribed via source and target branches