5
5
import bzrlib.commands
7
8
from shelf import Shelf
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__),
17
17
Option.OPTIONS['ignored'] = Option('ignored',
18
18
help='delete all ignored files.')
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]
194
194
command_decorators = []
196
command_decorators = []
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)
204
204
from errors import NoPyBaz
206
206
import baz_import
207
commands.append(baz_import.cmd_baz_import_branch)
208
207
commands.append(baz_import.cmd_baz_import)
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."
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)
232
219
if hasattr(bzrlib.commands, 'register_command'):
240
227
def test_suite():
243
from doctest import DocTestSuite, ELLIPSIS
228
from doctest import DocTestSuite
244
229
from unittest import TestSuite, TestLoader
245
230
import clean_tree
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())