~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Aaron Bentley
  • Date: 2006-02-01 03:37:33 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20060201033733-df5441ce73162009
Got selftest passing with storage API

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
"""
5
5
import bzrlib.commands
6
6
import push
 
7
import annotate
7
8
from shelf import Shelf
8
9
import sys
9
10
import os.path
10
11
from bzrlib.option import Option
11
12
import bzrlib.branch
12
13
from bzrlib.errors import BzrCommandError
 
14
sys.path.append(os.path.dirname(__file__))
13
15
from reweave_inventory import cmd_fix
14
 
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), 
15
 
                                                 "external")))
16
16
 
17
17
Option.OPTIONS['ignored'] = Option('ignored',
18
18
        help='delete all ignored files.')
104
104
    """
105
105
    takes_args = ['filename?']
106
106
    takes_options = ['strip']
107
 
    def run(self, filename=None, strip=1):
 
107
    def run(self, filename=None, strip=0):
108
108
        from patch import patch
109
109
        from bzrlib.branch import Branch
110
110
        b = Branch.open_containing('.')[0]
193
193
 
194
194
command_decorators = []
195
195
 
196
 
command_decorators = []
197
 
 
198
196
import bzrlib.builtins
 
197
if not hasattr(bzrlib.builtins, "cmd_annotate"):
 
198
    commands.append(annotate.cmd_annotate)
199
199
if not hasattr(bzrlib.builtins, "cmd_push"):
200
200
    commands.append(push.cmd_push)
201
201
else:
204
204
from errors import NoPyBaz
205
205
try:
206
206
    import baz_import
207
 
    commands.append(baz_import.cmd_baz_import_branch)
208
207
    commands.append(baz_import.cmd_baz_import)
209
208
 
210
209
except NoPyBaz:
211
 
    class cmd_baz_import_branch(bzrlib.commands.Command):
 
210
    class cmd_baz_import(bzrlib.commands.Command):
212
211
        """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=[]):
 
212
        takes_args = ['to_root_dir?', 'from_archive?']
 
213
        takes_options = ['verbose']
 
214
        def run(self, to_root_dir=None, from_archive=None, verbose=False):
218
215
            print "This command is disabled.  Please install PyBaz."
219
 
 
220
 
 
221
 
    class cmd_baz_import(bzrlib.commands.Command):
222
 
        """Disabled. (Requires PyBaz)"""
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))
 
216
    commands.append(cmd_baz_import)
230
217
 
231
218
 
232
219
if hasattr(bzrlib.commands, 'register_command'):
238
225
 
239
226
 
240
227
def test_suite():
241
 
    import baz_import
242
 
    import tests
243
 
    from doctest import DocTestSuite, ELLIPSIS
 
228
    from doctest import DocTestSuite
244
229
    from unittest import TestSuite, TestLoader
245
230
    import clean_tree
246
231
    import blackbox
247
232
    import shelf_tests
248
233
    result = TestSuite()
249
 
    result.addTest(DocTestSuite(bzrtools, optionflags=ELLIPSIS))
 
234
    result.addTest(DocTestSuite(bzrtools))
250
235
    result.addTest(clean_tree.test_suite())
251
 
    result.addTest(DocTestSuite(baz_import))
252
 
    result.addTest(tests.test_suite())
253
236
    result.addTest(TestLoader().loadTestsFromModule(shelf_tests))
254
237
    result.addTest(blackbox.test_suite())
255
238
    return result