~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/info.py

  • Committer: Shannon Weyrick
  • Date: 2011-11-04 13:40:04 UTC
  • mfrom: (6238 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6256.
  • Revision ID: weyrick@mozek.us-20111104134004-033t2wqhc3ydzm0a
Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
from bzrlib import (
24
24
    bzrdir,
 
25
    controldir,
25
26
    errors,
26
27
    hooks as _mod_hooks,
27
28
    osutils,
221
222
    """Show missing revisions in working tree."""
222
223
    branch = working.branch
223
224
    basis = working.basis_tree()
224
 
    branch_revno, branch_last_revision = branch.last_revision_info()
 
225
    try:
 
226
        branch_revno, branch_last_revision = branch.last_revision_info()
 
227
    except errors.UnsupportedOperation:
 
228
        return
225
229
    try:
226
230
        tree_last_id = working.get_parent_ids()[0]
227
231
    except IndexError:
268
272
 
269
273
def _show_branch_stats(branch, verbose, outfile):
270
274
    """Show statistics about a branch."""
271
 
    revno, head = branch.last_revision_info()
 
275
    try:
 
276
        revno, head = branch.last_revision_info()
 
277
    except errors.UnsupportedOperation:
 
278
        return {}
272
279
    outfile.write('\n')
273
280
    outfile.write('Branch history:\n')
274
281
    outfile.write('  %8d revision%s\n' % (revno, plural(revno)))
330
337
                repository = a_bzrdir.open_repository()
331
338
            except NoRepositoryPresent:
332
339
                # Return silently; cmd_info already returned NotBranchError
333
 
                # if no bzrdir could be opened.
 
340
                # if no controldir could be opened.
334
341
                return
335
342
            else:
336
343
                lockable = repository
445
452
        branch.user_url != tree.user_url):
446
453
        branch = None
447
454
        repository = None
448
 
    non_aliases = set(bzrdir.format_registry.keys())
449
 
    non_aliases.difference_update(bzrdir.format_registry.aliases())
 
455
    non_aliases = set(controldir.format_registry.keys())
 
456
    non_aliases.difference_update(controldir.format_registry.aliases())
450
457
    for key in non_aliases:
451
 
        format = bzrdir.format_registry.make_bzrdir(key)
 
458
        format = controldir.format_registry.make_bzrdir(key)
452
459
        if isinstance(format, bzrdir.BzrDirMetaFormat1):
453
460
            if (tree and format.workingtree_format !=
454
461
                tree._format):
466
473
        return 'unnamed'
467
474
    candidates.sort()
468
475
    new_candidates = [c for c in candidates if not
469
 
        bzrdir.format_registry.get_info(c).hidden]
 
476
        controldir.format_registry.get_info(c).hidden]
470
477
    if len(new_candidates) > 0:
471
478
        # If there are any non-hidden formats that match, only return those to
472
479
        # avoid listing hidden formats except when only a hidden format will