~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

  • Committer: John Arbash Meinel
  • Date: 2006-12-01 19:41:16 UTC
  • mfrom: (2158 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2159.
  • Revision ID: john@arbash-meinel.com-20061201194116-nvn5qhfxux5284jc
[merge] bzr.dev 2158

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import sys
20
20
 
21
21
from bzrlib import (
 
22
    errors,
 
23
    generate_ids,
22
24
    tests,
23
25
    urlutils,
24
26
    )
35
37
from bzrlib.transform import (TreeTransform, ROOT_PARENT, FinalPaths, 
36
38
                              resolve_conflicts, cook_conflicts, 
37
39
                              find_interesting, build_tree, get_backup_name)
38
 
from bzrlib.workingtree import gen_root_id
39
40
 
40
41
 
41
42
class TestTreeTransform(TestCaseInTempDir):
604
605
 
605
606
class TestTransformMerge(TestCaseInTempDir):
606
607
    def test_text_merge(self):
607
 
        root_id = gen_root_id()
 
608
        root_id = generate_ids.gen_root_id()
608
609
        base = TransformGroup("base", root_id)
609
610
        base.tt.new_file('a', base.root, 'a\nb\nc\nd\be\n', 'a')
610
611
        base.tt.new_file('b', base.root, 'b1', 'b')
683
684
    def test_file_merge(self):
684
685
        if not has_symlinks():
685
686
            raise TestSkipped('Symlinks are not supported on this platform')
686
 
        root_id = gen_root_id()
 
687
        root_id = generate_ids.gen_root_id()
687
688
        base = TransformGroup("BASE", root_id)
688
689
        this = TransformGroup("THIS", root_id)
689
690
        other = TransformGroup("OTHER", root_id)
724
725
        self.assertIs(os.path.lexists(this.wt.abspath('h.OTHER')), True)
725
726
 
726
727
    def test_filename_merge(self):
727
 
        root_id = gen_root_id()
 
728
        root_id = generate_ids.gen_root_id()
728
729
        base = TransformGroup("BASE", root_id)
729
730
        this = TransformGroup("THIS", root_id)
730
731
        other = TransformGroup("OTHER", root_id)
757
758
        self.assertEqual(this.wt.id2path('f'), pathjoin('b/f1'))
758
759
 
759
760
    def test_filename_merge_conflicts(self):
760
 
        root_id = gen_root_id()
 
761
        root_id = generate_ids.gen_root_id()
761
762
        base = TransformGroup("BASE", root_id)
762
763
        this = TransformGroup("THIS", root_id)
763
764
        other = TransformGroup("OTHER", root_id)
910
911
        target = self.make_branch_and_tree('target')
911
912
        self.build_tree(['target/name'])
912
913
        target.add('name')
913
 
        self.assertRaises(AssertionError, build_tree, source.basis_tree(),
914
 
                          target)
 
914
        self.assertRaises(errors.WorkingTreeAlreadyPopulated, 
 
915
            build_tree, source.basis_tree(), target)
915
916
 
916
917
 
917
918
class MockTransform(object):