~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Robert Collins
  • Date: 2006-05-05 04:43:35 UTC
  • mfrom: (1687.1.17 break-lock)
  • mto: This revision was merged to the branch mainline in revision 1701.
  • Revision ID: robertc@robertcollins.net-20060505044335-0e785bae0df1047e
Merge break-lock command.

Show diffs side-by-side

added added

removed removed

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