~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Aaron Bentley
  • Date: 2005-10-31 05:45:24 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20051031054524-292328b623bd775c
0.6.1 release

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
from bzrlib.option import Option
12
12
import bzrlib.branch
13
13
from bzrlib.errors import BzrCommandError
14
 
from reweave_inventory import cmd_fix
15
 
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), 
16
 
                                                 "external")))
 
14
sys.path.append(os.path.dirname(__file__))
17
15
 
18
16
Option.OPTIONS['ignored'] = Option('ignored',
19
17
        help='delete all ignored files.')
86
84
    """
87
85
    aliases = ['fetch-missing']
88
86
    takes_args = ['branch?']
89
 
    takes_options = [Option('no-fix')]
90
 
    def run(self, branch=None, no_fix=False):
 
87
    def run(self, branch=None):
91
88
        from fetch_ghosts import fetch_ghosts
92
 
        fetch_ghosts(branch, no_fix)
 
89
        fetch_ghosts(branch)
93
90
 
94
91
strip_help="""Strip the smallest prefix containing num leading slashes  from \
95
92
each file name found in the patch file."""
142
139
        return s.unshelve()
143
140
 
144
141
class cmd_shell(bzrlib.commands.Command):
145
 
    """Begin an interactive shell tailored for bzr.
146
 
    Bzr commands can be used without typing bzr first, and will be run natively
147
 
    when possible.  Tab completion is tailored for bzr.  The shell prompt shows
148
 
    the branch nick, revno, and path.
149
 
 
150
 
    If it encounters any moderately complicated shell command, it will punt to
151
 
    the system shell.
152
 
 
153
 
    Example:
154
 
    $ bzr shell
155
 
    bzr bzrtools:287/> status
156
 
    modified:
157
 
      __init__.py
158
 
    bzr bzrtools:287/> status --[TAB][TAB]
159
 
    --all        --help       --revision   --show-ids
160
 
    bzr bzrtools:287/> status --
161
 
    """
162
142
    def run(self):
163
143
        import shell
164
 
        return shell.run_shell()
 
144
        shell.run_shell()
165
145
 
166
146
commands = [cmd_shelve, cmd_unshelve, cmd_clean_tree, cmd_graph_ancestry,
167
 
            cmd_fetch_ghosts, cmd_patch, cmd_shell, cmd_fix]
168
 
 
169
 
command_decorators = []
170
 
 
171
 
command_decorators = []
 
147
            cmd_fetch_ghosts, cmd_patch, cmd_shell]
172
148
 
173
149
import bzrlib.builtins
174
150
if not hasattr(bzrlib.builtins, "cmd_annotate"):
175
151
    commands.append(annotate.cmd_annotate)
176
152
if not hasattr(bzrlib.builtins, "cmd_push"):
177
153
    commands.append(push.cmd_push)
178
 
else:
179
 
    command_decorators.append(push.cmd_push)
180
154
 
181
155
from errors import NoPyBaz
182
156
try:
183
157
    import baz_import
184
 
    commands.append(baz_import.cmd_baz_import_branch)
185
158
    commands.append(baz_import.cmd_baz_import)
186
159
 
187
160
except NoPyBaz:
193
166
            print "This command is disabled.  Please install PyBaz."
194
167
    commands.append(cmd_baz_import)
195
168
 
196
 
 
197
169
if hasattr(bzrlib.commands, 'register_command'):
198
170
    for command in commands:
199
171
        bzrlib.commands.register_command(command)
200
 
    for command in command_decorators:
201
 
        command._original_command = bzrlib.commands.register_command(
202
 
            command, True)
203
 
 
204
172
 
205
173
def test_suite():
206
 
    import baz_import
207
 
    import tests
208
174
    from doctest import DocTestSuite
209
175
    from unittest import TestSuite, TestLoader
210
176
    import clean_tree
213
179
    result = TestSuite()
214
180
    result.addTest(DocTestSuite(bzrtools))
215
181
    result.addTest(clean_tree.test_suite())
216
 
    result.addTest(DocTestSuite(baz_import))
217
 
    result.addTest(tests.test_suite())
218
182
    result.addTest(TestLoader().loadTestsFromModule(shelf_tests))
219
183
    result.addTest(blackbox.test_suite())
220
184
    return result