~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/info.py

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
from __future__ import absolute_import
 
18
 
17
19
__all__ = ['show_bzrdir_info']
18
20
 
19
21
from cStringIO import StringIO
198
200
            repository._format.get_format_description())
199
201
 
200
202
 
201
 
def _show_locking_info(repository, branch=None, working=None, outfile=None):
 
203
def _show_locking_info(repository=None, branch=None, working=None,
 
204
        outfile=None):
202
205
    """Show locking status of working, branch and repository."""
203
 
    if (repository.get_physical_lock_status() or
 
206
    if (repository and repository.get_physical_lock_status() or
204
207
        (branch and branch.get_physical_lock_status()) or
205
208
        (working and working.get_physical_lock_status())):
206
209
        outfile.write('\n')
350
353
    except (NoWorkingTree, NotLocalUrl, NotBranchError):
351
354
        tree = None
352
355
        try:
353
 
            branch = a_bzrdir.open_branch()
 
356
            branch = a_bzrdir.open_branch(name="")
354
357
        except NotBranchError:
355
358
            branch = None
356
359
            try:
411
414
    if branch is not None:
412
415
        show_committers = verbose >= 2
413
416
        stats = _show_branch_stats(branch, show_committers, outfile)
414
 
    else:
 
417
    elif repository is not None:
415
418
        stats = repository.gather_stats()
416
 
    if branch is None and working is None:
 
419
    if branch is None and working is None and repository is not None:
417
420
        _show_repository_info(repository, outfile)
418
 
    _show_repository_stats(repository, stats, outfile)
 
421
    if repository is not None:
 
422
        _show_repository_stats(repository, stats, outfile)
419
423
 
420
424
 
421
425
def describe_layout(repository=None, branch=None, tree=None, control=None):
440
444
            phrase = 'Shared repository'
441
445
        else:
442
446
            phrase = 'Unshared repository'
 
447
        extra = []
443
448
        if repository.make_working_trees():
444
 
            phrase += ' with trees'
 
449
            extra.append('trees')
 
450
        if len(control.get_branches()) > 0:
 
451
            extra.append('colocated branches')
 
452
        if extra:
 
453
            phrase += ' with ' + " and ".join(extra)
445
454
        return phrase
446
455
    else:
447
456
        if repository.is_shared():