~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/cmd_version_info.py

  • Committer: John Arbash Meinel
  • Date: 2006-09-22 15:19:55 UTC
  • mto: This revision was merged to the branch mainline in revision 2032.
  • Revision ID: john@arbash-meinel.com-20060922151955-1ce5162055c9538d
Add a test that we can find the version info when we only have a branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
from bzrlib import (
20
20
    branch,
 
21
    errors,
21
22
    version_info_formats,
22
23
    workingtree,
23
24
    )
24
25
from bzrlib.commands import Command
25
 
from bzrlib.errors import BzrCommandError
26
26
from bzrlib.option import Option
27
27
 
28
28
 
36
36
        return version_info_formats.get_builder(format)
37
37
    except KeyError:
38
38
        formats = version_info_formats.get_builder_formats()
39
 
        raise BzrCommandError('No known version info format %s.'
40
 
                              ' Supported types are: %s'
41
 
                              % (format, formats))
 
39
        raise errors.BzrCommandError('No known version info format %s.'
 
40
                                     ' Supported types are: %s'
 
41
                                     % (format, formats))
42
42
 
43
43
 
44
44
class cmd_version_info(Command):
70
70
        wt = None
71
71
        try:
72
72
            wt = workingtree.WorkingTree.open_containing(location)[0]
73
 
        except NoWorkingTree:
 
73
        except errors.NoWorkingTree:
74
74
            b = branch.Branch.open(location)
75
75
        else:
76
76
            b = wt.branch