~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/cmd_version_info.py

  • Committer: Jelmer Vernooij
  • Date: 2011-10-06 10:25:48 UTC
  • mto: This revision was merged to the branch mainline in revision 6200.
  • Revision ID: jelmer@samba.org-20111006102548-cli99jin34oongor
Add --revision argument to 'bzr version-info'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
                     Option('include-file-revisions',
84
84
                            help='Include the last revision for each file.'),
85
85
                     Option('template', type=str, help='Template for the output.'),
 
86
                     'revision',
86
87
                     ]
87
88
    takes_args = ['location?']
88
89
 
90
91
 
91
92
    def run(self, location=None, format=None,
92
93
            all=False, check_clean=False, include_history=False,
93
 
            include_file_revisions=False, template=None):
 
94
            include_file_revisions=False, template=None,
 
95
            revision=None):
 
96
 
 
97
        if revision and len(revision) > 1:
 
98
            raise errors.BzrCommandError(
 
99
                gettext('bzr version-info --revision takes exactly'
 
100
                        ' one revision specifier'))
94
101
 
95
102
        if location is None:
96
103
            location = '.'
109
116
        if all or template:
110
117
            include_history = True
111
118
            check_clean = True
112
 
            include_file_revisions=True
 
119
            include_file_revisions = True
 
120
 
 
121
        if revision is not None:
 
122
            revision_id = revision[0].as_revision_id(b)
 
123
        else:
 
124
            revision_id = None
113
125
 
114
126
        builder = format(b, working_tree=wt,
115
127
                check_for_clean=check_clean,
116
128
                include_revision_history=include_history,
117
129
                include_file_revisions=include_file_revisions,
118
 
                template=template)
 
130
                template=template, revision_id=revision_id)
119
131
        builder.generate(self.outf)