~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to show_paths.py

  • Committer: Aaron Bentley
  • Date: 2007-01-08 17:27:48 UTC
  • Revision ID: abentley@panoramicfeedback.com-20070108172748-1b22qtszaadoby89
Improve bzr import docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
Written by Alexander Belchenko, 2006
5
5
"""
6
6
 
7
 
from bzrlib.commands import register_command
8
 
from command import BzrToolsCommand
 
7
from bzrlib.commands import Command, register_command
9
8
from bzrlib.option import Option
10
9
 
11
10
 
46
45
#/def _bzr_system_info
47
46
 
48
47
 
49
 
class cmd_show_paths(BzrToolsCommand):
 
48
class cmd_show_paths(Command):
50
49
    """Show paths used by bzr itself and for current branch.
51
50
 
52
 
    The standard "bzr info" command now includes this functionality.
53
 
 
54
51
    If you run this command from branch you'll see
55
52
    saved path locations for current branch:
56
53
 
61
58
        * submit to   - default reference location for bundle generation
62
59
    """
63
60
 
64
 
    takes_options = [Option('system',
65
 
                            help='Show full bzr system information.'),
 
61
    takes_options = [Option('system', help='Show full bzr system information'),
66
62
                    ]
67
 
    takes_args = ['branch?']
68
 
 
69
 
    hidden = True
70
 
 
71
 
    _see_also = ['info']
72
 
 
73
 
    def run(self, system=False, branch=u'.'):
 
63
 
 
64
    def run(self, system=False):
74
65
        import sys
75
66
 
76
67
        from bzrlib.branch import Branch
91
82
            _bzr_system_info(to_file)
92
83
 
93
84
        try:
94
 
            branch = Branch.open_containing(branch)[0]
 
85
            try:
 
86
                branch = WorkingTree.open_containing(u'.')[0].branch
 
87
            except NoWorkingTree:
 
88
                branch = Branch.open_containing(u'.')[0]
 
89
 
95
90
 
96
91
            if system:
97
92
                print >>to_file