~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/info.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-05-07 00:59:42 UTC
  • mfrom: (4340.1.1 bzr.dev)
  • Revision ID: pqm@pqm.ubuntu.com-20090507005942-wnvvomd3130f1vph
(Jelmer) Mention --force in the error message when unable to access
        in the master branch in 'bzr switch'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
17
17
__all__ = ['show_bzrdir_info']
18
18
 
19
19
from cStringIO import StringIO
 
20
import os
20
21
import time
21
22
import sys
22
23
 
23
24
from bzrlib import (
24
25
    bzrdir,
 
26
    diff,
25
27
    errors,
26
28
    hooks as _mod_hooks,
27
29
    osutils,
78
80
 
79
81
def gather_location_info(repository, branch=None, working=None):
80
82
    locs = {}
81
 
    repository_path = repository.user_url
 
83
    repository_path = repository.bzrdir.root_transport.base
82
84
    if branch is not None:
83
 
        branch_path = branch.user_url
 
85
        branch_path = branch.bzrdir.root_transport.base
84
86
        master_path = branch.get_bound_location()
85
87
        if master_path is None:
86
88
            master_path = branch_path
88
90
        branch_path = None
89
91
        master_path = None
90
92
    if working:
91
 
        working_path = working.user_url
 
93
        working_path = working.bzrdir.root_transport.base
92
94
        if working_path != branch_path:
93
95
            locs['light checkout root'] = working_path
94
96
        if master_path != branch_path:
418
420
        if branch is None and tree is not None:
419
421
            phrase = "branchless tree"
420
422
        else:
421
 
            if (tree is not None and tree.user_url !=
422
 
                branch.user_url):
 
423
            if (tree is not None and tree.bzrdir.root_transport.base !=
 
424
                branch.bzrdir.root_transport.base):
423
425
                independence = ''
424
426
                phrase = "Lightweight checkout"
425
427
            elif branch.get_bound_location() is not None:
444
446
    """
445
447
    candidates  = []
446
448
    if (branch is not None and tree is not None and
447
 
        branch.user_url != tree.user_url):
 
449
        branch.bzrdir.root_transport.base !=
 
450
        tree.bzrdir.root_transport.base):
448
451
        branch = None
449
452
        repository = None
450
453
    non_aliases = set(bzrdir.format_registry.keys())
481
484
    """Hooks for the info command."""
482
485
 
483
486
    def __init__(self):
484
 
        super(InfoHooks, self).__init__()
485
487
        self.create_hook(_mod_hooks.HookPoint('repository',
486
488
            "Invoked when displaying the statistics for a repository. "
487
489
            "repository is called with a statistics dictionary as returned "