~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Aaron Bentley
  • Date: 2006-03-10 20:15:17 UTC
  • mfrom: (147.1.73 bzrtools)
  • Revision ID: abentley@panoramicfeedback.com-20060310201517-958f8d9307a49b2e
Merged the Arch-1 bzrtools import

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
from bzrlib.option import Option
11
11
import bzrlib.branch
12
12
from bzrlib.errors import BzrCommandError
13
 
sys.path.append(os.path.dirname(__file__))
14
13
from reweave_inventory import cmd_fix
 
14
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), 
 
15
                                                 "external")))
15
16
 
16
17
Option.OPTIONS['ignored'] = Option('ignored',
17
18
        help='delete all ignored files.')
192
193
 
193
194
command_decorators = []
194
195
 
 
196
command_decorators = []
 
197
 
195
198
import bzrlib.builtins
196
199
if not hasattr(bzrlib.builtins, "cmd_push"):
197
200
    commands.append(push.cmd_push)
201
204
from errors import NoPyBaz
202
205
try:
203
206
    import baz_import
 
207
    commands.append(baz_import.cmd_baz_import_branch)
204
208
    commands.append(baz_import.cmd_baz_import)
205
209
 
206
210
except NoPyBaz:
 
211
    class cmd_baz_import_branch(bzrlib.commands.Command):
 
212
        """Disabled. (Requires PyBaz)"""
 
213
        takes_args = ['to_location?', 'from_branch?', 'reuse_history*']
 
214
        takes_options = ['verbose', Option('max-count', type=int)]
 
215
        def run(self, to_location=None, from_branch=None, fast=False, 
 
216
                max_count=None, verbose=False, dry_run=False,
 
217
                reuse_history_list=[]):
 
218
            print "This command is disabled.  Please install PyBaz."
 
219
 
 
220
 
207
221
    class cmd_baz_import(bzrlib.commands.Command):
208
222
        """Disabled. (Requires PyBaz)"""
209
 
        takes_args = ['to_root_dir?', 'from_archive?']
210
 
        takes_options = ['verbose']
211
 
        def run(self, to_root_dir=None, from_archive=None, verbose=False):
212
 
            print "This command is disabled.  Please install PyBaz."
213
 
    commands.append(cmd_baz_import)
 
223
        takes_args = ['to_root_dir?', 'from_archive?', 'reuse_history*']
 
224
        takes_options = ['verbose', Option('prefixes', type=str,
 
225
                         help="Prefixes of branches to import")]
 
226
        def run(self, to_root_dir=None, from_archive=None, verbose=False,
 
227
                reuse_history_list=[], prefixes=None):
 
228
                print "This command is disabled.  Please install PyBaz."
 
229
    commands.extend((cmd_baz_import_branch, cmd_baz_import))
214
230
 
215
231
 
216
232
if hasattr(bzrlib.commands, 'register_command'):
222
238
 
223
239
 
224
240
def test_suite():
 
241
    import baz_import
 
242
    import tests
225
243
    from doctest import DocTestSuite, ELLIPSIS
226
244
    from unittest import TestSuite, TestLoader
227
245
    import clean_tree
230
248
    result = TestSuite()
231
249
    result.addTest(DocTestSuite(bzrtools, optionflags=ELLIPSIS))
232
250
    result.addTest(clean_tree.test_suite())
 
251
    result.addTest(DocTestSuite(baz_import))
 
252
    result.addTest(tests.test_suite())
233
253
    result.addTest(TestLoader().loadTestsFromModule(shelf_tests))
234
254
    result.addTest(blackbox.test_suite())
235
255
    return result