~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

[merge] jam-integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
1180
1180
 
1181
1181
    @display_command
1182
1182
    def run(self, filename, revision=None):
1183
 
        if revision is None:
1184
 
            raise BzrCommandError("bzr cat requires a revision number")
1185
 
        elif len(revision) != 1:
 
1183
        if revision is not None and len(revision) != 1:
1186
1184
            raise BzrCommandError("bzr cat --revision takes exactly one number")
1187
1185
        tree = None
1188
1186
        try:
1190
1188
            b = tree.branch
1191
1189
        except NotBranchError:
1192
1190
            pass
 
1191
 
1193
1192
        if tree is None:
1194
1193
            b, relpath = Branch.open_containing(filename)
1195
 
        b.print_file(relpath, revision[0].in_history(b).revno)
 
1194
        if revision is None:
 
1195
            revision_id = b.last_revision()
 
1196
        else:
 
1197
            revision_id = revision[0].in_history(b).rev_id
 
1198
        b.print_file(relpath, revision_id)
1196
1199
 
1197
1200
 
1198
1201
class cmd_local_time_offset(Command):