15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
from cStringIO import StringIO
21
20
from bzrlib import (
27
from bzrlib.branch import Branch
28
from bzrlib.bzrdir import BzrDir
29
27
from bzrlib.lockdir import LockDir
30
28
from bzrlib.mutabletree import needs_tree_write_lock
31
29
from bzrlib.tests import TestCase, TestCaseWithTransport, TestSkipped
32
from bzrlib.transport import get_transport
33
30
from bzrlib.workingtree import (
138
135
dir.create_repository()
139
136
dir.create_branch()
140
137
format.initialize(dir)
141
t = get_transport(url)
138
t = transport.get_transport(url)
142
139
found_format = workingtree.WorkingTreeFormat.find_format(dir)
143
140
self.failUnless(isinstance(found_format, format.__class__))
144
141
check_format(workingtree.WorkingTreeFormat3(), "bar")
349
346
self.build_tree_contents([('this/hello', 'Hello World')])
350
347
this.commit('Add World')
351
348
this.merge_from_branch(other.branch)
352
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
349
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
353
350
this.conflicts())
354
351
this.auto_resolve()
355
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
352
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
356
353
this.conflicts())
357
354
self.build_tree_contents([('this/hello', '<<<<<<<')])
358
355
this.auto_resolve()
359
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
356
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
360
357
this.conflicts())
361
358
self.build_tree_contents([('this/hello', '=======')])
362
359
this.auto_resolve()
363
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
360
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
364
361
this.conflicts())
365
362
self.build_tree_contents([('this/hello', '\n>>>>>>>')])
366
363
remaining, resolved = this.auto_resolve()
367
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
364
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
368
365
this.conflicts())
369
366
self.assertEqual([], resolved)
370
367
self.build_tree_contents([('this/hello', 'hELLO wORLD')])
371
368
remaining, resolved = this.auto_resolve()
372
369
self.assertEqual([], this.conflicts())
373
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
370
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
375
372
self.failIfExists('this/hello.BASE')
378
375
tree = self.make_branch_and_tree('tree')
379
376
self.build_tree(['tree/hello/'])
380
377
tree.add('hello', 'hello-id')
381
file_conflict = conflicts.TextConflict('file', None, 'hello-id')
378
file_conflict = conflicts.TextConflict('file', 'hello-id')
382
379
tree.set_conflicts(conflicts.ConflictList([file_conflict]))
383
380
tree.auto_resolve()