26
26
from bzrlib.branch import Branch
27
27
import bzrlib.bzrdir as bzrdir
28
28
from bzrlib.commands import Command, display_command
29
from bzrlib.revision import common_ancestor
30
29
import bzrlib.errors as errors
31
30
from bzrlib.errors import (BzrError, BzrCheckError, BzrCommandError,
32
31
NotBranchError, DivergedBranches, NotConflicted,
36
35
from bzrlib.merge import Merge3Merger
37
36
from bzrlib.option import Option
38
37
from bzrlib.progress import DummyProgress, ProgressPhase
38
from bzrlib.revision import common_ancestor
39
39
from bzrlib.revisionspec import RevisionSpec
40
40
import bzrlib.trace
41
41
from bzrlib.trace import mutter, note, log_error, warning, is_quiet
273
273
added, ignored = bzrlib.add.smart_add(file_list, not no_recurse,
275
275
if len(ignored) > 0:
276
for glob in sorted(ignored.keys()):
277
match_len = len(ignored[glob])
277
for glob in sorted(ignored.keys()):
279
278
for path in ignored[glob]:
280
279
print "ignored %s matching \"%s\"" % (path, glob)
282
print "ignored %d file(s) matching \"%s\"" % (match_len,
282
for glob, paths in ignored.items():
283
match_len += len(paths)
284
print "ignored %d file(s)." % match_len
284
285
print "If you wish to add some of these files, please add them"\
519
520
dir_to = br_from.bzrdir.clone(location)
520
521
br_to = dir_to.open_branch()
521
old_rh = br_to.revision_history()
522
count = len(br_to.revision_history())
524
old_rh = br_to.revision_history()
524
tree_to = dir_to.open_workingtree()
525
except errors.NotLocalUrl:
526
# TODO: This should be updated for branches which don't have a
527
# working tree, as opposed to ones where we just couldn't
529
warning('This transport does not update the working '
530
'tree of: %s' % (br_to.base,))
531
count = br_to.pull(br_from, overwrite)
532
except NoWorkingTree:
533
count = br_to.pull(br_from, overwrite)
535
count = tree_to.pull(br_from, overwrite)
536
except DivergedBranches:
537
raise BzrCommandError("These branches have diverged."
538
" Try a merge then push with overwrite.")
527
tree_to = dir_to.open_workingtree()
528
except errors.NotLocalUrl:
529
warning('This transport does not update the working '
530
'tree of: %s' % (br_to.base,))
531
count = br_to.pull(br_from, overwrite)
532
except NoWorkingTree:
533
count = br_to.pull(br_from, overwrite)
535
count = tree_to.pull(br_from, overwrite)
536
except DivergedBranches:
537
raise BzrCommandError("These branches have diverged."
538
" Try a merge then push with overwrite.")
539
539
note('%d revision(s) pushed.' % (count,))
1782
1782
help='Use a different transport by default '
1783
1783
'throughout the test suite.',
1784
1784
type=get_transport_type),
1785
Option('benchmark', help='run the bzr bencharks.'),
1787
1788
def run(self, testspecs_list=None, verbose=False, one=False,
1788
keep_output=False, transport=None):
1789
keep_output=False, transport=None, benchmark=None):
1789
1790
import bzrlib.ui
1790
1791
from bzrlib.tests import selftest
1792
import bzrlib.benchmarks as benchmarks
1791
1793
# we don't want progress meters from the tests to go to the
1792
1794
# real output; and we don't want log messages cluttering up
1793
1795
# the real logs.
1794
1796
save_ui = bzrlib.ui.ui_factory
1797
print '%10s: %s' % ('bzr', bzrlib.osutils.realpath(sys.argv[0]))
1798
print '%10s: %s' % ('bzrlib', bzrlib.__path__[0])
1795
1800
bzrlib.trace.info('running tests...')
1797
1802
bzrlib.ui.ui_factory = bzrlib.ui.SilentUIFactory()
1799
1804
pattern = '|'.join(testspecs_list)
1808
test_suite_factory = benchmarks.test_suite
1810
test_suite_factory = None
1802
1811
result = selftest(verbose=verbose,
1803
1812
pattern=pattern,
1804
1813
stop_on_failure=one,
1805
1814
keep_output=keep_output,
1806
transport=transport)
1815
transport=transport,
1816
test_suite_factory=test_suite_factory)
1808
1818
bzrlib.trace.info('tests passed')