Rev 2226: Fix fetch_replace_move_root. in file:///data/jelmer/bzr-svn/mappings/
Jelmer Vernooij
jelmer at samba.org
Sun Dec 7 23:25:10 GMT 2008
At file:///data/jelmer/bzr-svn/mappings/
------------------------------------------------------------
revno: 2226
revision-id: jelmer at samba.org-20081207232507-5hs00babyx7ojem4
parent: jelmer at samba.org-20081207223310-admsgx9eri6gz67e
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: mappings
timestamp: Mon 2008-12-08 00:25:07 +0100
message:
Fix fetch_replace_move_root.
modified:
fetch.py fetch.py-20060625004942-x2lfaib8ra707a8p-1
mapping2.py mapping.py-20080904055555-lw057kjuadn0r2ma-2
tests/test_fetch.py test_fetch.py-20070624210302-luvgwjmlfysk5qeq-1
=== modified file 'fetch.py'
--- a/fetch.py 2008-12-06 04:00:40 +0000
+++ b/fetch.py 2008-12-07 23:25:07 +0000
@@ -533,7 +533,10 @@
else:
# Just inherit file id from previous
old_file_id = self.old_inventory.root.file_id
- file_id = self._get_id_map().get("", old_file_id)
+ # At the moment, the root file id NEVER changes, except for the
+ # first commit.
+ # file_id = self._get_map_id("")
+ file_id = old_file_id
file_parents = [self.old_inventory.root.revision]
assert isinstance(file_id, str)
=== modified file 'mapping2.py'
--- a/mapping2.py 2008-12-07 02:58:26 +0000
+++ b/mapping2.py 2008-12-07 23:25:07 +0000
@@ -91,7 +91,7 @@
def import_text_revisions_fileprops(self, fileprops):
return {}
- def get_rhs_parent_fileprops(self, fileprops):
+ def get_rhs_parents_fileprops(self, fileprops):
value = fileprops.get(SVN_PROP_BZR_MERGE, "")
if value == "":
return ()
=== modified file 'tests/test_fetch.py'
--- a/tests/test_fetch.py 2008-12-06 04:00:40 +0000
+++ b/tests/test_fetch.py 2008-12-07 23:25:07 +0000
@@ -342,8 +342,13 @@
oldrepos.set_layout(RootLayout())
to_bzrdir = BzrDir.create("f", format.get_rich_root_format())
repo = to_bzrdir.create_repository()
- repo.fetch(oldrepos, oldrepos.generate_revision_id(3, "branch2",
- oldrepos.get_mapping()))
+ last_rev = oldrepos.generate_revision_id(3, "branch2",
+ oldrepos.get_mapping())
+ repo.fetch(oldrepos, last_rev)
+ self.assertEquals(repo.get_inventory(last_rev).root.file_id,
+ oldrepos.get_mapping().generate_file_id(
+ oldrepos.uuid, 1, "branch1", u""))
+
def test_fetch_replace(self):
repos_url = self.make_repository('d')
More information about the bazaar-commits
mailing list