~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-05-05 08:29:29 UTC
  • mfrom: (1697.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060505082929-a037ee137f1ff240
Merge break-lock command.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2467
2467
 
2468
2468
    CAUTION: Locks should only be broken when you are sure that the process
2469
2469
    holding the lock has been stopped.
 
2470
 
 
2471
    You can get information on what locks are open via the 'bzr info' command.
2470
2472
    
2471
2473
    example:
2472
 
        bzr break-lock .
 
2474
        bzr break-lock
2473
2475
    """
2474
 
    takes_args = ['location']
2475
 
    takes_options = [Option('show',
2476
 
                            help="just show information on the lock, " \
2477
 
                                 "don't break it"),
2478
 
                    ]
2479
 
    def run(self, location, show=False):
2480
 
        raise NotImplementedError("sorry, break-lock is not complete yet; "
2481
 
                "you can remove the 'held' directory manually to break the lock")
 
2476
    takes_args = ['location?']
 
2477
 
 
2478
    def run(self, location=None, show=False):
 
2479
        if location is None:
 
2480
            location = u'.'
 
2481
        control, relpath = bzrdir.BzrDir.open_containing(location)
 
2482
        try:
 
2483
            control.break_lock()
 
2484
        except NotImplementedError:
 
2485
            pass
 
2486
        
2482
2487
 
2483
2488
 
2484
2489
# command-line interpretation helper for merge-related commands