/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lockdir.py

  • Committer: John Arbash Meinel
  • Date: 2006-09-15 00:44:57 UTC
  • mfrom: (2009 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2050.
  • Revision ID: john@arbash-meinel.com-20060915004457-902cec0526a39337
[merge] bzr.dev 2009

Show diffs side-by-side

added added

removed removed

Lines of Context:
409
409
        finally:
410
410
            bzrlib.ui.ui_factory = orig_factory
411
411
 
 
412
    def test_create_missing_base_directory(self):
 
413
        """If LockDir.path doesn't exist, it can be created
 
414
 
 
415
        Some people manually remove the entire lock/ directory trying
 
416
        to unlock a stuck repository/branch/etc. Rather than failing
 
417
        after that, just create the lock directory when needed.
 
418
        """
 
419
        t = self.get_transport()
 
420
        lf1 = LockDir(t, 'test_lock')
 
421
 
 
422
        lf1.create()
 
423
        self.failUnless(t.has('test_lock'))
 
424
 
 
425
        t.rmdir('test_lock')
 
426
        self.failIf(t.has('test_lock'))
 
427
 
 
428
        # This will create 'test_lock' if it needs to
 
429
        lf1.lock_write()
 
430
        self.failUnless(t.has('test_lock'))
 
431
        self.failUnless(t.has('test_lock/held/info'))
 
432
 
 
433
        lf1.unlock()
 
434
        self.failIf(t.has('test_lock/held/info'))
 
435
 
412
436
    def test__format_lock_info(self):
413
437
        ld1 = self.get_lock()
414
438
        ld1.create()