~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/info.py

  • Committer: Jelmer Vernooij
  • Date: 2011-11-21 16:02:13 UTC
  • mto: This revision was merged to the branch mainline in revision 6285.
  • Revision ID: jelmer@samba.org-20111121160213-w3w6jkfps6s091gq
Allow lazy_regex.lazy_compile patterns to be pickled.

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
 
 
19
17
__all__ = ['show_bzrdir_info']
20
18
 
21
19
from cStringIO import StringIO
200
198
            repository._format.get_format_description())
201
199
 
202
200
 
203
 
def _show_locking_info(repository=None, branch=None, working=None,
204
 
        outfile=None):
 
201
def _show_locking_info(repository, branch=None, working=None, outfile=None):
205
202
    """Show locking status of working, branch and repository."""
206
 
    if (repository and repository.get_physical_lock_status() or
 
203
    if (repository.get_physical_lock_status() or
207
204
        (branch and branch.get_physical_lock_status()) or
208
205
        (working and working.get_physical_lock_status())):
209
206
        outfile.write('\n')
353
350
    except (NoWorkingTree, NotLocalUrl, NotBranchError):
354
351
        tree = None
355
352
        try:
356
 
            branch = a_bzrdir.open_branch(name="")
 
353
            branch = a_bzrdir.open_branch()
357
354
        except NotBranchError:
358
355
            branch = None
359
356
            try:
414
411
    if branch is not None:
415
412
        show_committers = verbose >= 2
416
413
        stats = _show_branch_stats(branch, show_committers, outfile)
417
 
    elif repository is not None:
 
414
    else:
418
415
        stats = repository.gather_stats()
419
 
    if branch is None and working is None and repository is not None:
 
416
    if branch is None and working is None:
420
417
        _show_repository_info(repository, outfile)
421
 
    if repository is not None:
422
 
        _show_repository_stats(repository, stats, outfile)
 
418
    _show_repository_stats(repository, stats, outfile)
423
419
 
424
420
 
425
421
def describe_layout(repository=None, branch=None, tree=None, control=None):
444
440
            phrase = 'Shared repository'
445
441
        else:
446
442
            phrase = 'Unshared repository'
447
 
        extra = []
448
443
        if repository.make_working_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)
 
444
            phrase += ' with trees'
454
445
        return phrase
455
446
    else:
456
447
        if repository.is_shared():