347
assert os.path.exists('branch1')
348
assert not os.path.exists('branch2')
349
# Can't create a branch if it already exists
350
runbzr('branch branch1', retcode=1)
351
# Can't create a branch if its parent doesn't exist
352
runbzr('branch /unlikely/to/exist', retcode=1)
353
runbzr('branch branch1 branch2')
354
assert exists('branch2')
355
assert exists('branch2/sub1')
356
assert exists('branch2/sub1/hello.txt')
358
runbzr('branch --revision 0 branch1 branch3')
359
assert not exists('branch3/sub1/hello.txt')
360
runbzr('branch --revision 0..3 branch1 branch4', retcode=1)
364
runbzr('pull', retcode=1)
365
runbzr('pull ../branch2')
368
runbzr('commit --unchanged -m empty')
370
chdir('../../branch2')
372
runbzr('commit --unchanged -m empty')
374
runbzr('commit --unchanged -m empty')
375
runbzr('pull', retcode=1)
378
progress('status after remove')
379
mkdir('status-after-remove')
380
# see mail from William Dodé, 2005-05-25
381
# $ bzr init; touch a; bzr add a; bzr commit -m "add a"
382
# * looking for changes...
387
# bzr: local variable 'kind' referenced before assignment
388
# at /vrac/python/bazaar-ng/bzrlib/diff.py:286 in compare_trees()
389
# see ~/.bzr.log for debug information
390
chdir('status-after-remove')
392
file('a', 'w').write('foo')
394
runbzr(['commit', '-m', 'add a'])
402
progress("recursive and non-recursive add")
407
fp = os.path.join('foo', 'test.txt')
411
runbzr('add --no-recurse foo')
412
runbzr('file-id foo')
413
runbzr('file-id ' + fp, 1) # not versioned yet
414
runbzr('commit -m add-dir-only')
416
self.runbzr('file-id ' + fp, 1) # still not versioned
418
self.runbzr('add foo')
419
self.runbzr('file-id ' + fp)
420
self.runbzr('commit -m add-sub-file')
426
344
class RevertCommand(ExternalBase):
427
345
def runTest(self):
428
346
self.runbzr('init')