~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Robert Collins
  • Date: 2006-02-16 11:19:47 UTC
  • mto: (1534.1.24 integration)
  • mto: This revision was merged to the branch mainline in revision 1554.
  • Revision ID: robertc@robertcollins.net-20060216111947-e6946ac37fe8b21a
Correct buggy test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1450
1450
    this command. When the default format has changed you may also be warned
1451
1451
    during other operations to upgrade.
1452
1452
    """
 
1453
    # NB: this is used from the class without creating an instance, which is
 
1454
    # why it does not have a self parameter.
 
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)
 
1462
 
1453
1463
    takes_args = ['url?']
1454
 
 
1455
 
    def run(self, url='.'):
 
1464
    takes_options = [
 
1465
                     Option('format', 
 
1466
                            help='Upgrade to a specific format rather than the'
 
1467
                                 ' current default format. Currently this '
 
1468
                                 ' option only accepts =metadir',
 
1469
                            type=get_format_type),
 
1470
                    ]
 
1471
 
 
1472
 
 
1473
    def run(self, url='.', format=None):
1456
1474
        from bzrlib.upgrade import upgrade
1457
 
        upgrade(url)
 
1475
        upgrade(url, format)
1458
1476
 
1459
1477
 
1460
1478
class cmd_whoami(Command):