~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

MergeĀ fromĀ mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
714
714
    
715
715
    @display_command
716
716
    def run(self, branch=None):
717
 
        import info
718
 
        b = WorkingTree.open_containing(branch)[0].branch
719
 
        info.show_info(b)
 
717
        import bzrlib.info
 
718
        bzrlib.info.show_bzrdir_info(bzrdir.BzrDir.open_containing(branch)[0])
720
719
 
721
720
 
722
721
class cmd_remove(Command):
819
818
            # locations if the user supplies an extended path
820
819
            if not os.path.exists(location):
821
820
                os.mkdir(location)
822
 
        WorkingTree.create_standalone(location)
 
821
        bzrdir.BzrDir.create_standalone_workingtree(location)
823
822
 
824
823
 
825
824
class cmd_diff(Command):
1451
1450
 
1452
1451
        if c.needs_write:
1453
1452
            c.write()
1454
 
            
 
1453
 
 
1454
 
 
1455
def get_format_type(typestring):
 
1456
    """Parse and return a format specifier."""
 
1457
    if typestring == "metadir":
 
1458
        return bzrdir.BzrDirMetaFormat1
 
1459
    msg = "No known bzr-dir format %s. Supported types are: metadir\n" %\
 
1460
        (typestring)
 
1461
    raise BzrCommandError(msg)
1455
1462
 
1456
1463
 
1457
1464
class cmd_upgrade(Command):
1462
1469
    during other operations to upgrade.
1463
1470
    """
1464
1471
    takes_args = ['url?']
1465
 
 
1466
 
    def run(self, url='.'):
 
1472
    takes_options = [
 
1473
                     Option('format', 
 
1474
                            help='Upgrade to a specific format rather than the'
 
1475
                                 ' current default format. Currently this '
 
1476
                                 ' option only accepts =metadir',
 
1477
                            type=get_format_type),
 
1478
                    ]
 
1479
 
 
1480
 
 
1481
    def run(self, url='.', format=None):
1467
1482
        from bzrlib.upgrade import upgrade
1468
 
        upgrade(url)
 
1483
        upgrade(url, format)
1469
1484
 
1470
1485
 
1471
1486
class cmd_whoami(Command):