Exemplo n.º 1
0
 def test_add_nested_norev(self):
     """Add a nested tree with no specific revision referenced."""
     branch = self.make_svn_branch('d', lossy=True)
     repos = branch.repository
     mapping = repos.get_mapping()
     inv = Inventory(root_id=b'blabloe')
     inventory_add_external(
         inv, b'blabloe', 'blie/bla',
         mapping.revision_id_foreign_to_bzr(
             (repos.uuid, branch.get_branch_path(), 1)), None, branch.base)
     expected_ie = TreeReference(
         mapping.generate_file_id((repos.uuid, branch.get_branch_path(), 1),
                                  u""),
         'bla',
         inv.path2id('blie'),
         reference_revision=CURRENT_REVISION,
         revision=mapping.revision_id_foreign_to_bzr(
             (repos.uuid, branch.get_branch_path(), 1)))
     ie = inv.get_entry(inv.path2id('blie/bla'))
     self.assertEquals(expected_ie.file_id, ie.file_id)
     self.assertEquals(expected_ie.revision, ie.revision)
     self.assertEquals(expected_ie.name, ie.name)
     self.assertEquals(expected_ie.reference_revision,
                       ie.reference_revision)
     self.assertEquals(expected_ie.parent_id, ie.parent_id)
     self.assertEqual(expected_ie, ie)
Exemplo n.º 2
0
 def test_add_simple_rev(self):
     branch = self.make_svn_branch('d', lossy=True)  #1
     repos = branch.repository
     inv = Inventory(root_id=b'blabloe')
     mapping = repos.get_mapping()
     inventory_add_external(
         inv, b'blabloe', 'bla',
         mapping.revision_id_foreign_to_bzr(
             (repos.uuid, branch.get_branch_path(), 1)), 1, branch.base)
     expected_ie = TreeReference(
         mapping.generate_file_id((repos.uuid, branch.get_branch_path(), 1),
                                  u""),
         'bla',
         b'blabloe',
         revision=mapping.revision_id_foreign_to_bzr(
             (repos.uuid, branch.get_branch_path(), 1)),
         reference_revision=branch.last_revision())
     ie = inv.get_entry(inv.path2id('bla'))
     self.assertEqual(branch.last_revision(), ie.reference_revision)
     self.assertEquals(expected_ie.file_id, ie.file_id)
     self.assertEquals(expected_ie.revision, ie.revision)
     self.assertEquals(expected_ie.name, ie.name)
     self.assertEquals(expected_ie.reference_revision,
                       ie.reference_revision)
     self.assertEquals(expected_ie.parent_id, ie.parent_id)
     self.assertEqual(expected_ie, ie)
Exemplo n.º 3
0
    def test_add_simple_norev(self):
        branch = self.make_svn_branch('d', lossy=True)
        repos = branch.repository
        mapping = repos.get_mapping()
        inv = Inventory(root_id='blabloe')
        inventory_add_external(inv, 'blabloe', 'bla',
            mapping.revision_id_foreign_to_bzr((repos.uuid, branch.get_branch_path(), 1)), None,
            branch.base)

        self.assertEqual(TreeReference(
            mapping.generate_file_id((repos.uuid, branch.get_branch_path(), 1), u""),
             'bla', 'blabloe',
             reference_revision=CURRENT_REVISION,
             revision=mapping.revision_id_foreign_to_bzr((repos.uuid, branch.get_branch_path(), 1))),
             inv.get_entry(inv.path2id('bla')))