32
30
from bzrlib.selftest import TestCaseInTempDir, BzrTestBase
33
from bzrlib.branch import Branch
34
from bzrlib.commands import run_bzr
37
32
class ExternalBase(TestCaseInTempDir):
38
33
def runbzr(self, args, retcode=0,backtick=False):
218
215
a.get_revision_xml(b.last_patch())
220
217
self.log('pending merges: %s', a.pending_merges())
221
# assert a.pending_merges() == [b.last_patch()], "Assertion %s %s" \
222
# % (a.pending_merges(), b.last_patch())
225
"""Pull changes from one branch to another."""
229
self.example_branch()
231
self.runbzr('branch a b')
233
self.runbzr('commit -m blah --unchanged')
237
assert a.revision_history() == b.revision_history()[:-1]
238
self.runbzr('pull ../b')
239
assert a.revision_history() == b.revision_history()
240
self.runbzr('commit -m blah2 --unchanged')
242
self.runbzr('commit -m blah3 --unchanged')
243
self.runbzr('pull ../a', retcode=1)
245
def test_add_reports(self):
246
"""add command prints the names of added files."""
247
b = Branch('.', init=True)
248
self.build_tree(['top.txt', 'dir/', 'dir/sub.txt'])
250
from cStringIO import StringIO
253
ret = self.apply_redirected(None, out, None,
256
self.assertEquals(ret, 0)
258
# the ordering is not defined at the moment
259
results = sorted(out.getvalue().rstrip('\n').split('\n'))
260
self.assertEquals(['added dir',
218
# assert a.pending_merges() == [b.last_patch()], "Assertion %s %s" \
219
# % (a.pending_merges(), b.last_patch())
266
221
class OldTests(ExternalBase):
267
222
"""old tests moved from ./testbzr."""