89
89
class cmd_cat_revision(Command):
90
"""Write out metadata for a revision."""
90
"""Write out metadata for a revision.
92
The revision to print can either be specified by a specific
93
revision identifier, or you can use --revision.
93
takes_args = ['revision_id']
97
takes_args = ['revision_id?']
98
takes_options = ['revision']
95
def run(self, revision_id):
100
def run(self, revision_id=None, revision=None):
101
from bzrlib.revisionspec import RevisionSpec
103
if revision_id is not None and revision is not None:
104
raise BzrCommandError('You can only supply one of revision_id or --revision')
105
if revision_id is None and revision is None:
106
raise BzrCommandError('You must supply either --revision or a revision_id')
96
107
b = Branch.open_containing('.')
97
sys.stdout.write(b.get_revision_xml_file(revision_id).read())
108
if revision_id is not None:
109
sys.stdout.write(b.get_revision_xml_file(revision_id).read())
110
elif revision is not None:
113
raise BzrCommandError('You cannot specify a NULL revision.')
114
revno, rev_id = rev.in_history(b)
115
sys.stdout.write(b.get_revision_xml_file(rev_id).read())
100
118
class cmd_revno(Command):