29
30
from bzrlib.lockdir import LockDir
30
31
from bzrlib.mutabletree import needs_tree_write_lock
31
32
from bzrlib.tests import TestCase, TestCaseWithTransport, TestSkipped
32
from bzrlib.transport import get_transport
33
33
from bzrlib.workingtree import (
138
138
dir.create_repository()
139
139
dir.create_branch()
140
140
format.initialize(dir)
141
t = get_transport(url)
141
t = transport.get_transport(url)
142
142
found_format = workingtree.WorkingTreeFormat.find_format(dir)
143
143
self.failUnless(isinstance(found_format, format.__class__))
144
144
check_format(workingtree.WorkingTreeFormat3(), "bar")
303
303
self.assertEqual(
304
304
'method_with_tree_write_lock',
305
305
tree.method_with_tree_write_lock.__name__)
306
self.assertDocstring(
307
307
"A lock_tree_write decorated method that returns its arguments.",
308
tree.method_with_tree_write_lock.__doc__)
308
tree.method_with_tree_write_lock)
310
310
kwargs = {'a':'b'}
311
311
result = tree.method_with_tree_write_lock(1,2,3, a='b')
349
349
self.build_tree_contents([('this/hello', 'Hello World')])
350
350
this.commit('Add World')
351
351
this.merge_from_branch(other.branch)
352
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
352
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
353
353
this.conflicts())
354
354
this.auto_resolve()
355
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
355
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
356
356
this.conflicts())
357
357
self.build_tree_contents([('this/hello', '<<<<<<<')])
358
358
this.auto_resolve()
359
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
359
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
360
360
this.conflicts())
361
361
self.build_tree_contents([('this/hello', '=======')])
362
362
this.auto_resolve()
363
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
363
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
364
364
this.conflicts())
365
365
self.build_tree_contents([('this/hello', '\n>>>>>>>')])
366
366
remaining, resolved = this.auto_resolve()
367
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
367
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
368
368
this.conflicts())
369
369
self.assertEqual([], resolved)
370
370
self.build_tree_contents([('this/hello', 'hELLO wORLD')])
371
371
remaining, resolved = this.auto_resolve()
372
372
self.assertEqual([], this.conflicts())
373
self.assertEqual([conflicts.TextConflict('hello', None, 'hello_id')],
373
self.assertEqual([conflicts.TextConflict('hello', 'hello_id')],
375
375
self.failIfExists('this/hello.BASE')
378
378
tree = self.make_branch_and_tree('tree')
379
379
self.build_tree(['tree/hello/'])
380
380
tree.add('hello', 'hello-id')
381
file_conflict = conflicts.TextConflict('file', None, 'hello-id')
381
file_conflict = conflicts.TextConflict('file', 'hello-id')
382
382
tree.set_conflicts(conflicts.ConflictList([file_conflict]))
383
383
tree.auto_resolve()