~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Robert Collins
  • Date: 2006-02-17 04:17:09 UTC
  • mto: (1534.1.24 integration)
  • mto: This revision was merged to the branch mainline in revision 1554.
  • Revision ID: robertc@robertcollins.net-20060217041709-7251eb701f69ca7e
Review feedback.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1440
1440
 
1441
1441
        if c.needs_write:
1442
1442
            c.write()
1443
 
            
 
1443
 
 
1444
 
 
1445
def get_format_type(typestring):
 
1446
    """Parse and return a format specifier."""
 
1447
    if typestring == "metadir":
 
1448
        return bzrdir.BzrDirMetaFormat1
 
1449
    msg = "No known bzr-dir format %s. Supported types are: metadir\n" %\
 
1450
        (typestring)
 
1451
    raise BzrCommandError(msg)
1444
1452
 
1445
1453
 
1446
1454
class cmd_upgrade(Command):
1450
1458
    this command. When the default format has changed you may also be warned
1451
1459
    during other operations to upgrade.
1452
1460
    """
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
 
 
1463
1461
    takes_args = ['url?']
1464
1462
    takes_options = [
1465
1463
                     Option('format',