377
378
scenarios = mirror_scenarios(
379
# File modified/deleted
380
# File modified on both sides
380
381
(dict(_base_actions='create_file',
381
382
_path='file', _file_id='file-id'),
382
383
('filed_modified_A',
383
384
dict(actions='modify_file_A', check='file_has_content_A')),
384
385
('file_modified_B',
385
386
dict(actions='modify_file_B', check='file_has_content_B')),),
387
# File modified on both sides in dir
388
(dict(_base_actions='create_file_in_dir',
389
_path='dir/file', _file_id='file-id'),
390
('filed_modified_A_in_dir',
391
dict(actions='modify_file_A',
392
check='file_in_dir_has_content_A')),
394
dict(actions='modify_file_B',
395
check='file_in_dir_has_content_B')),),
388
def do_create_file(self):
389
return [('add', ('file', 'file-id', 'file', 'trunk content\n'))]
398
def do_create_file(self, path='file'):
399
return [('add', (path, 'file-id', 'file', 'trunk content\n'))]
391
401
def do_modify_file_A(self):
392
402
return [('modify', ('file-id', 'trunk content\nfeature A\n'))]
394
404
def do_modify_file_B(self):
395
405
return [('modify', ('file-id', 'trunk content\nfeature B\n'))]
397
def check_file_has_content_A(self):
398
self.assertFileEqual('trunk content\nfeature A\n', 'branch/file')
400
def check_file_has_content_B(self):
401
self.assertFileEqual('trunk content\nfeature B\n', 'branch/file')
407
def check_file_has_content_A(self, path='file'):
408
self.assertFileEqual('trunk content\nfeature A\n',
409
osutils.pathjoin('branch', path))
411
def check_file_has_content_B(self, path='file'):
412
self.assertFileEqual('trunk content\nfeature B\n',
413
osutils.pathjoin('branch', path))
415
def do_create_file_in_dir(self):
416
return [('add', ('dir', 'dir-id', 'directory', '')),
417
] + self.do_create_file('dir/file')
419
def check_file_in_dir_has_content_A(self):
420
self.check_file_has_content_A('dir/file')
422
def check_file_in_dir_has_content_B(self):
423
self.check_file_has_content_B('dir/file')
403
425
def _get_resolve_path_arg(self, wt, action):
404
426
return self._path