/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Jelmer Vernooij
  • Date: 2008-08-30 17:08:54 UTC
  • mto: This revision was merged to the branch mainline in revision 3673.
  • Revision ID: jelmer@samba.org-20080830170854-ztumaeiftyc3vm4c
Show proper error rather than traceback when an unknown revision id is specified to bzr cat-revision.

Show diffs side-by-side

added added

removed removed

Lines of Context:
226
226
        # TODO: jam 20060112 should cat-revision always output utf-8?
227
227
        if revision_id is not None:
228
228
            revision_id = osutils.safe_revision_id(revision_id, warn=False)
229
 
            self.outf.write(b.repository.get_revision_xml(revision_id).decode('utf-8'))
 
229
            try:
 
230
                self.outf.write(b.repository.get_revision_xml(revision_id).decode('utf-8'))
 
231
            except errors.NoSuchRevision:
 
232
                msg = "The repository %s contains no revision %s." % (b.repository.base,
 
233
                    revision_id)
 
234
                raise errors.BzrCommandError(msg)
230
235
        elif revision is not None:
231
236
            for rev in revision:
232
237
                if rev is None: