~lifeless/bzr/index.range_map

« back to all changes in this revision

Viewing changes to bzrlib/info.py

  • Committer: Robert Collins
  • Date: 2008-06-19 01:17:19 UTC
  • mfrom: (3218.1.277 +trunk)
  • Revision ID: robertc@robertcollins.net-20080619011719-1c4g4uxzzhdls2wf
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
from bzrlib.errors import (NoWorkingTree, NotBranchError,
31
31
                           NoRepositoryPresent, NotLocalUrl)
32
32
from bzrlib.missing import find_unmerged
33
 
from bzrlib.symbol_versioning import (deprecated_function,
34
 
        zero_eighteen)
35
33
 
36
34
 
37
35
def plural(n, base='', pl=None):
440
438
        tree.bzrdir.root_transport.base):
441
439
        branch = None
442
440
        repository = None
443
 
    for key in bzrdir.format_registry.keys():
 
441
    non_aliases = set(bzrdir.format_registry.keys())
 
442
    non_aliases.difference_update(bzrdir.format_registry.aliases())
 
443
    for key in non_aliases:
444
444
        format = bzrdir.format_registry.make_bzrdir(key)
445
445
        if isinstance(format, bzrdir.BzrDirMetaFormat1):
446
446
            if (tree and format.workingtree_format !=
457
457
        candidates.append(key)
458
458
    if len(candidates) == 0:
459
459
        return 'unnamed'
460
 
    new_candidates = [c for c in candidates if c != 'default']
461
 
    if len(new_candidates) > 0:
462
 
        candidates = new_candidates
 
460
    candidates.sort()
463
461
    new_candidates = [c for c in candidates if not
464
462
        bzrdir.format_registry.get_info(c).hidden]
465
463
    if len(new_candidates) > 0:
 
464
        # If there are any non-hidden formats that match, only return those to
 
465
        # avoid listing hidden formats except when only a hidden format will
 
466
        # do.
466
467
        candidates = new_candidates
467
468
    return ' or '.join(candidates)