~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Alexander Belchenko
  • Date: 2006-07-05 11:19:41 UTC
  • mto: This revision was merged to the branch mainline in revision 465.
  • Revision ID: bialix@ukr.net-20060705111941-f3b55cb754a98d18
print local paths for branch without file:// prefix

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
        from bzrlib.plugin import DEFAULT_PLUGIN_PATH
24
24
        from bzrlib import plugins
25
25
        from bzrlib import trace
 
26
        from bzrlib import urlutils
26
27
        from bzrlib.workingtree import WorkingTree
27
28
 
 
29
        def local_path(path):
 
30
            if path.startswith("file://"):
 
31
                return urlutils.local_path_from_url(path)
 
32
            else:
 
33
                return path
 
34
 
28
35
        FORMAT = '%16s: %s'
29
36
 
30
37
        print "*** Main bzr paths info ***"
55
62
            print "*** Current branch paths info ***"
56
63
 
57
64
            branch_root = branch.bzrdir.root_transport.base
58
 
            print FORMAT % ('branch root', branch_root)
 
65
            print FORMAT % ('branch root', local_path(branch_root))
59
66
 
60
67
            pull_loc = branch.get_parent() or 'None'
61
 
            print FORMAT % ('branch pull from', pull_loc)
 
68
            print FORMAT % ('branch pull from', local_path(pull_loc))
62
69
 
63
70
            push_loc = branch.get_push_location() or 'None'
64
 
            print FORMAT % ('branch push to', push_loc)
 
71
            print FORMAT % ('branch push to', local_path(push_loc))
65
72
 
66
73
            bound_loc = branch.get_bound_location() or 'None'
67
 
            print FORMAT % ('bound to branch', bound_loc)
 
74
            print FORMAT % ('bound to branch', local_path(bound_loc))
68
75
 
69
76
            if hasattr(branch, 'get_submit_branch'):
70
 
                submit_loc = branch.get_submit_branch()
71
 
                print FORMAT % ('submit to branch', submit_loc)
 
77
                submit_loc = branch.get_submit_branch() or 'None'
 
78
                print FORMAT % ('submit to branch', local_path(submit_loc))
72
79
 
73
80
        except NotBranchError:
74
81
            pass