~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Martin Pool
  • Date: 2006-03-03 02:18:15 UTC
  • mto: This revision was merged to the branch mainline in revision 1593.
  • Revision ID: mbp@sourcefrog.net-20060303021815-872742b7b3357302
Clean up duplicate BranchNotLocked error and rename to ObjectNotLocked

Show diffs side-by-side

added added

removed removed

Lines of Context:
300
300
        self.obj = obj
301
301
 
302
302
 
303
 
class BranchNotLocked(LockError):
304
 
    """Branch %(branch)r is not locked"""
305
 
    def __init__(self, branch):
306
 
        # XXX: sometimes called with a LockableFiles instance not a Branch
307
 
        self.branch = branch
 
303
class ObjectNotLocked(LockError):
 
304
    """%(obj)r is not locked"""
 
305
    # this can indicate that any particular object is not locked; see also
 
306
    # LockNotHeld which means that a particular *lock* object is not held by
 
307
    # the caller -- perhaps they should be unified.
 
308
    def __init__(self, obj):
 
309
        self.obj = obj
308
310
 
309
311
 
310
312
class ReadOnlyObjectDirtiedError(ReadOnlyError):
346
348
        self.lock = lock
347
349
 
348
350
 
349
 
# XXX: duplicated definition
350
 
# TODO: change this to "object not locked"
351
 
class BranchNotLocked(LockError):
352
 
    """Branch %(branch)r not locked"""
353
 
    def __init__(self, branch):
354
 
        self.branch = branch
355
 
 
356
 
 
357
351
class PointlessCommit(BzrNewError):
358
352
    """No changes to commit"""
359
353