~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/info.py

  • Committer: Andrew Bennetts
  • Date: 2010-01-18 07:00:11 UTC
  • mto: (4973.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4975.
  • Revision ID: andrew.bennetts@canonical.com-20100118070011-zu374wvd0lcgai5a
Move news_merge plugin from contrib to bzrlib/plugins, change it to be enabled via a 'news_merge_files' config option, move more code out of the __init__ to minimise overhead, and add lots of docstrings, add NEWS entry.

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())