~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lockdir.py

  • Committer: Adeodato Simó
  • Date: 2006-07-13 00:25:34 UTC
  • mto: (1711.2.88 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1862.
  • Revision ID: dato@net.com.org.es-20060713002534-0f6001589ff30c28
Really use terminal_width() for pending-merge display. r1707 mentioned
this in NEWS, but did not include that part of the fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (C) 2006 Canonical Ltd
2
 
#
 
2
 
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
5
5
# the Free Software Foundation; either version 2 of the License, or
6
6
# (at your option) any later version.
7
 
#
 
7
 
8
8
# This program is distributed in the hope that it will be useful,
9
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
11
# GNU General Public License for more details.
12
 
#
 
12
 
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
352
352
            self.assertRaises(LockBroken, ld1.unlock)
353
353
        finally:
354
354
            bzrlib.ui.ui_factory = orig_factory
355
 
 
356
 
    def test_create_missing_base_directory(self):
357
 
        """If LockDir.path doesn't exist, it can be created
358
 
 
359
 
        Some people manually remove the entire lock/ directory trying
360
 
        to unlock a stuck repository/branch/etc. Rather than failing
361
 
        after that, just create the lock directory when needed.
362
 
        """
363
 
        t = self.get_transport()
364
 
        lf1 = LockDir(t, 'test_lock')
365
 
 
366
 
        lf1.create()
367
 
        self.failUnless(t.has('test_lock'))
368
 
 
369
 
        t.rmdir('test_lock')
370
 
        self.failIf(t.has('test_lock'))
371
 
 
372
 
        # This will create 'test_lock' if it needs to
373
 
        lf1.lock_write()
374
 
        self.failUnless(t.has('test_lock'))
375
 
        self.failUnless(t.has('test_lock/held/info'))
376
 
 
377
 
        lf1.unlock()
378
 
        self.failIf(t.has('test_lock/held/info'))