~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/info.py

  • Committer: Jelmer Vernooij
  • Date: 2011-06-16 11:57:36 UTC
  • mto: This revision was merged to the branch mainline in revision 5987.
  • Revision ID: jelmer@samba.org-20110616115736-5xuzwdf87qb81su4
Use iter_ancestry rather than get_ancestry.

Show diffs side-by-side

added added

removed removed

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