~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

  • Committer: Martin Pool
  • Date: 2006-03-03 09:38:28 UTC
  • mto: This revision was merged to the branch mainline in revision 1593.
  • Revision ID: mbp@sourcefrog.net-20060303093828-eeaecf4e3fc4fc15
[revert] broken changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
156
156
        t = control.get_repository_transport(None)
157
157
        self.assertEqualDiff('Bazaar-NG Repository format 7',
158
158
                             t.get('format').read())
 
159
        self.assertEqualDiff('', t.get('lock').read())
159
160
        self.assertTrue(S_ISDIR(t.stat('revision-store').st_mode))
160
161
        self.assertTrue(S_ISDIR(t.stat('weaves').st_mode))
161
162
        self.assertEqualDiff('# bzr weave file v5\n'
185
186
                             t.get('inventory.weave').read())
186
187
        self.assertFalse(t.has('branch-lock'))
187
188
 
188
 
    def test_creates_lockdir(self):
 
189
    def test_locked_by_lockdir(self):
189
190
        """Make sure it appears to be controlled by a LockDir existence"""
190
191
        control = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())
191
192
        repo = repository.RepositoryFormat7().initialize(control, shared=True)
193
194
        self.assertFalse(t.has('lock'))
194
195
        repo.lock_write()
195
196
        self.assertTrue(t.has('lock'))
196
 
        self.assertTrue(t.has('lock/info'))
197
 
 
198
 
    def test_uses_lockdir(self):
199
 
        """repo format 7 actually locks on lockdir"""
200
 
        base_url = self.get_url()
201
 
        control = bzrdir.BzrDirMetaFormat1().initialize(base_url)
202
 
        repo = repository.RepositoryFormat7().initialize(control, shared=True)
203
 
        t = control.get_repository_transport(None)
204
 
        repo.lock_write()
205
 
        repo.unlock()
206
 
        del repo
207
 
        # make sure the same lock is created by opening it
208
 
        repo = repository.Repository.open(base_url)
209
 
        self.assertFalse(t.has('lock'))
210
 
        repo.lock_write()
211
 
        self.assertTrue(t.has('lock'))
212
 
        self.assertTrue(t.has('lock/info'))
213
 
        self.assertTrue(S_ISDIR(t.stat('lock').st_mode))
214
 
        repo.unlock()
215
 
        self.assertFalse(t.has('lock'))
216
197
 
217
198
    def test_shared_no_tree_disk_layout(self):
218
199
        control = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())
228
209
        t = control.get_repository_transport(None)
229
210
        self.assertEqualDiff('Bazaar-NG Repository format 7',
230
211
                             t.get('format').read())
231
 
        ## self.assertEqualDiff('', t.get('lock').read())
 
212
        self.assertEqualDiff('', t.get('lock').read())
232
213
        self.assertEqualDiff('', t.get('shared-storage').read())
233
214
        self.assertEqualDiff('', t.get('no-working-trees').read())
234
215
        repo.set_make_working_trees(True)