33
33
from bzrlib.selftest import TestCaseInTempDir, BzrTestBase
34
34
from bzrlib.branch import Branch
35
from bzrlib.commands import run_bzr
38
37
class ExternalBase(TestCaseInTempDir):
39
39
def runbzr(self, args, retcode=0, backtick=False):
40
40
if isinstance(args, basestring):
41
41
args = args.split()
170
170
from bzrlib.branch import Branch
171
171
b = Branch.initialize('.')
172
172
self.build_tree(['a', 'c', 'subdir/'])
173
self.run_bzr('add', self.test_dir)
174
self.run_bzr('mv', 'a', 'b')
175
self.run_bzr('mv', 'b', 'subdir')
176
self.run_bzr('mv', 'subdir/b', 'a')
177
self.run_bzr('mv', 'a', 'c', 'subdir')
178
self.run_bzr('mv', 'subdir/a', 'subdir/newa')
173
self.run_bzr_captured(['add', self.test_dir])
174
self.run_bzr_captured(['mv', 'a', 'b'])
175
self.run_bzr_captured(['mv', 'b', 'subdir'])
176
self.run_bzr_captured(['mv', 'subdir/b', 'a'])
177
self.run_bzr_captured(['mv', 'a', 'c', 'subdir'])
178
self.run_bzr_captured(['mv', 'subdir/a', 'subdir/newa'])
181
181
def test_main_version(self):
287
287
"""add command prints the names of added files."""
288
288
b = Branch.initialize('.')
289
289
self.build_tree(['top.txt', 'dir/', 'dir/sub.txt'])
291
ret = self.apply_redirected(None, out, None,
294
self.assertEquals(ret, 0)
290
out = self.run_bzr_captured(['add'], retcode = 0)[0]
295
291
# the ordering is not defined at the moment
296
results = sorted(out.getvalue().rstrip('\n').split('\n'))
292
results = sorted(out.rstrip('\n').split('\n'))
297
293
self.assertEquals(['added dir',
298
294
'added dir/sub.txt',
299
295
'added top.txt',],