~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Aaron Bentley
  • Date: 2006-02-21 05:51:15 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20060221055115-d1a74f28c9016983
Fixed the push command

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__))
13
14
from reweave_inventory import cmd_fix
14
 
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), 
15
 
                                                 "external")))
16
15
 
17
16
Option.OPTIONS['ignored'] = Option('ignored',
18
17
        help='delete all ignored files.')
104
103
    """
105
104
    takes_args = ['filename?']
106
105
    takes_options = ['strip']
107
 
    def run(self, filename=None, strip=1):
 
106
    def run(self, filename=None, strip=0):
108
107
        from patch import patch
109
108
        from bzrlib.branch import Branch
110
109
        b = Branch.open_containing('.')[0]
193
192
 
194
193
command_decorators = []
195
194
 
196
 
command_decorators = []
197
 
 
198
195
import bzrlib.builtins
199
196
if not hasattr(bzrlib.builtins, "cmd_push"):
200
197
    commands.append(push.cmd_push)
204
201
from errors import NoPyBaz
205
202
try:
206
203
    import baz_import
207
 
    commands.append(baz_import.cmd_baz_import_branch)
208
204
    commands.append(baz_import.cmd_baz_import)
209
205
 
210
206
except NoPyBaz:
211
 
    class cmd_baz_import_branch(bzrlib.commands.Command):
 
207
    class cmd_baz_import(bzrlib.commands.Command):
212
208
        """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=[]):
 
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):
218
212
            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))
 
213
    commands.append(cmd_baz_import)
230
214
 
231
215
 
232
216
if hasattr(bzrlib.commands, 'register_command'):
238
222
 
239
223
 
240
224
def test_suite():
241
 
    import baz_import
242
 
    import tests
243
 
    from doctest import DocTestSuite, ELLIPSIS
 
225
    from doctest import DocTestSuite
244
226
    from unittest import TestSuite, TestLoader
245
227
    import clean_tree
246
228
    import blackbox
247
229
    import shelf_tests
248
230
    result = TestSuite()
249
 
    result.addTest(DocTestSuite(bzrtools, optionflags=ELLIPSIS))
 
231
    result.addTest(DocTestSuite(bzrtools))
250
232
    result.addTest(clean_tree.test_suite())
251
 
    result.addTest(DocTestSuite(baz_import))
252
 
    result.addTest(tests.test_suite())
253
233
    result.addTest(TestLoader().loadTestsFromModule(shelf_tests))
254
234
    result.addTest(blackbox.test_suite())
255
235
    return result