~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

[merge] fixes from 0.1 series

Show diffs side-by-side

added added

removed removed

Lines of Context:
388
388
        import errno
389
389
        from shutil import rmtree
390
390
        cache_root = tempfile.mkdtemp()
391
 
        try:
392
 
            if revision is None:
393
 
                revision = [None]
394
 
            elif len(revision) > 1:
395
 
                raise BzrCommandError(
396
 
                    'bzr branch --revision takes exactly 1 revision value')
397
 
            try:
398
 
                br_from = Branch.open(from_location)
399
 
            except OSError, e:
400
 
                if e.errno == errno.ENOENT:
401
 
                    raise BzrCommandError('Source location "%s" does not'
402
 
                                          ' exist.' % to_location)
403
 
                else:
404
 
                    raise
 
391
        if revision is None:
 
392
            revision = [None]
 
393
        elif len(revision) > 1:
 
394
            raise BzrCommandError(
 
395
                'bzr branch --revision takes exactly 1 revision value')
 
396
        try:
 
397
            br_from = Branch.open(from_location)
 
398
        except OSError, e:
 
399
            if e.errno == errno.ENOENT:
 
400
                raise BzrCommandError('Source location "%s" does not'
 
401
                                      ' exist.' % to_location)
 
402
            else:
 
403
                raise
 
404
        br_from.lock_read()
 
405
        try:
405
406
            br_from.setup_caching(cache_root)
406
407
            if basis is not None:
407
408
                basis_branch = Branch.open_containing(basis)
433
434
            except bzrlib.errors.UnlistableBranch:
434
435
                msg = "The branch %s cannot be used as a --basis"
435
436
        finally:
 
437
            br_from.unlock()
436
438
            rmtree(cache_root)
437
439
 
438
440
 
461
463
    
462
464
    def run(self, branch=None):
463
465
        import info
464
 
 
465
466
        b = Branch.open_containing(branch)
466
467
        info.show_info(b)
467
468