~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/branch_implementations/test_parent.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-04-15 08:20:33 UTC
  • mfrom: (4288.1.12 push.roundtrips)
  • Revision ID: pqm@pqm.ubuntu.com-20090415082033-tds4zs962x6kwc2c
(robertc) Add a Branch.set_parent_location verb and reduce lock
        churning to reduce network round trips. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
            #       paths as well? Nobody has complained about it.
72
72
            pass
73
73
        else:
 
74
            b.lock_write()
74
75
            b._set_parent_location('/local/abs/path')
 
76
            b.unlock()
75
77
            self.assertEqual('file:///local/abs/path', b.get_parent())
76
78
 
77
79
    def test_get_invalid_parent(self):
83
85
        # Force the relative path to be something invalid
84
86
        # This should attempt to go outside the filesystem
85
87
        path = ('../'*(n_dirs+5)) + 'foo'
 
88
        b.lock_write()
86
89
        b._set_parent_location(path)
 
90
        b.unlock()
87
91
 
88
92
        # With an invalid branch parent, just return None
89
93
        self.assertRaises(bzrlib.errors.InaccessibleParent, b.get_parent)