18
18
from cStringIO import StringIO
21
from bzrlib import errors, tests
22
26
from bzrlib.merge_directive import MergeDirective2
24
28
from bzrlib.plugins.gtk.diff import (
80
84
view.show_diff(None)
82
86
start, end = buf.get_bounds()
83
text = buf.get_text(start, end)
87
text = buf.get_text(start, end, True)
84
88
self.assertContainsRe(text,
85
89
"=== added file '\xce\xa9'\n"
86
90
'--- .*\t1970-01-01 00:00:00 \\+0000\n'
303
308
[('a-id', 'a', 'removed', 'a'),
304
309
('b-id', 'b', 'removed', 'b/'),
312
def test_status_missing_file(self):
313
this = self.make_branch_and_tree('this')
314
self.build_tree(['this/foo'])
315
this.add(['foo'], ['foo-id'])
318
other = this.bzrdir.sprout('other').open_workingtree()
320
os.remove('this/foo')
321
this.remove('foo', force=True)
322
this.commit('remove')
324
f = open('other/foo', 'wt')
326
f.write('Modified\n')
329
other.commit('modified')
331
this.merge_from_branch(other.branch)
332
conflicts.resolve(this)
334
self.assertStatusEqual(
335
[('foo-id', 'foo.OTHER', 'missing', 'foo.OTHER'),],
338
def test_status_missing_directory(self):
339
this = self.make_branch_and_tree('this')
340
self.build_tree(['this/foo/', 'this/foo/bar'])
341
this.add(['foo', 'foo/bar'], ['foo-id', 'bar-id'])
344
other = this.bzrdir.sprout('other').open_workingtree()
346
os.remove('this/foo/bar')
348
this.remove('foo', force=True)
349
this.commit('remove')
351
f = open('other/foo/bar', 'wt')
353
f.write('Modified\n')
356
other.commit('modified')
358
this.merge_from_branch(other.branch)
359
conflicts.resolve(this)
361
self.assertStatusEqual(
362
[('foo-id', u'foo', 'added', u'foo/'),
363
('bar-id', u'foo/bar.OTHER', 'missing', u'foo/bar.OTHER'),],