~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/info.py

  • Committer: Jelmer Vernooij
  • Date: 2011-09-30 12:58:20 UTC
  • mto: This revision was merged to the branch mainline in revision 6183.
  • Revision ID: jelmer@samba.org-20110930125820-k2x13osm1sgj1rn0
If the branch doesn't support last_revision_info, don't display
the relevant information in 'bzr info -v' rather than raising a traceback.

Show diffs side-by-side

added added

removed removed

Lines of Context:
221
221
    """Show missing revisions in working tree."""
222
222
    branch = working.branch
223
223
    basis = working.basis_tree()
224
 
    branch_revno, branch_last_revision = branch.last_revision_info()
 
224
    try:
 
225
        branch_revno, branch_last_revision = branch.last_revision_info()
 
226
    except errors.UnsupportedOperation:
 
227
        return
225
228
    try:
226
229
        tree_last_id = working.get_parent_ids()[0]
227
230
    except IndexError:
268
271
 
269
272
def _show_branch_stats(branch, verbose, outfile):
270
273
    """Show statistics about a branch."""
271
 
    revno, head = branch.last_revision_info()
 
274
    try:
 
275
        revno, head = branch.last_revision_info()
 
276
    except errors.UnsupportedOperation:
 
277
        return {}
272
278
    outfile.write('\n')
273
279
    outfile.write('Branch history:\n')
274
280
    outfile.write('  %8d revision%s\n' % (revno, plural(revno)))