Rev 2253: Deal with newly appearing file ids correctly in dpush(). in http://people.samba.org/bzr/jelmer/bzr-svn/0.5

Jelmer Vernooij jelmer at samba.org
Mon Dec 8 20:48:23 GMT 2008


At http://people.samba.org/bzr/jelmer/bzr-svn/0.5

------------------------------------------------------------
revno: 2253
revision-id: jelmer at samba.org-20081208204820-1iv08johco067nur
parent: jelmer at samba.org-20081208202813-zsnpsfhyoqmo7zw5
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.5
timestamp: Mon 2008-12-08 21:48:20 +0100
message:
  Deal with newly appearing file ids correctly in dpush().
modified:
  NEWS                           news-20061231030336-h9fhq245ie0de8bs-1
  commit.py                      commit.py-20060607190346-qvq128wgfubhhgm2-1
  foreign/__init__.py            foreign.py-20080827193306-rxeku2c2obec90c4-1
  tests/test_push.py             test_push.py-20070201165715-g2ievcdfqi33wqsy-1
=== modified file 'NEWS'
--- a/NEWS	2008-12-08 19:56:16 +0000
+++ b/NEWS	2008-12-08 20:48:20 +0000
@@ -14,6 +14,8 @@
    * Fix pushing to repositories not allowing the setting of revision 
      properties.
 
+   * Deal with newly appearing file ids correctly in dpush(). (#300979)
+
 bzr-svn 0.5.0~rc1			2008-12-08
 
   CHANGES

=== modified file 'commit.py'
--- a/commit.py	2008-12-08 20:02:31 +0000
+++ b/commit.py	2008-12-08 20:48:20 +0000
@@ -382,11 +382,6 @@
         else:
             self.old_inv = old_inv
 
-        # Not all repositories appear to set Inventory.revision_id, 
-        # so allow None as well.
-        assert self.old_inv.revision_id in (None, self.base_revid), \
-                "%s != %s" % (self.old_inv.revision_id, self.base_revid)
-
         # Determine revisions merged in this one
         merges = filter(lambda x: x != self.base_revid, parents)
 
@@ -857,7 +852,6 @@
     :param stop_revision: If not None, stop at this revision.
     :return: Map of old revids to new revids.
     """
-    fileid_map = {} # FIXME: Fill in fileid_map
     source.lock_write()
     try:
         if stop_revision is None:
@@ -886,7 +880,7 @@
                 target._clear_cached_state()
         finally:
             pb.finished()
-        return revid_map, fileid_map
+        return revid_map
     finally:
         source.unlock()
 
@@ -911,7 +905,7 @@
     """
     assert rev.revision_id in (None, revision_id)
     old_tree = source_repo.revision_tree(revision_id)
-    base_tree = source_repo.revision_tree(base_revid)
+    base_tree = source_repo.revision_tree(rev.parent_ids[0])
 
     if push_metadata:
         base_revids = rev.parent_ids
@@ -923,11 +917,6 @@
     except NoSuchRevision:
         opt_signature = None
 
-    if base_revids == rev.parent_ids:
-        parent_trees = [base_tree]
-    else:
-        parent_trees = source_repo.revision_trees(rev.parent_ids)
-
     builder = SvnCommitBuilder(target_repo, branch_path, base_revids,
                                config, rev.timestamp,
                                rev.timezone, rev.committer, rev.properties, 
@@ -938,7 +927,12 @@
                                texts=source_repo.texts,
                                append_revisions_only=append_revisions_only,
                                override_svn_revprops=override_svn_revprops)
-                         
+    parent_trees = [base_tree]
+    for p in rev.parent_ids[1:]:
+        try:
+            parent_trees.append(source_repo.revision_tree(p))
+        except NoSuchRevision:
+            pass # Ghost, ignore
     replay_delta(builder, parent_trees, old_tree)
     try:
         revid = builder.commit(rev.message)

=== modified file 'foreign/__init__.py'
--- a/foreign/__init__.py	2008-12-08 20:28:13 +0000
+++ b/foreign/__init__.py	2008-12-08 20:48:20 +0000
@@ -160,7 +160,7 @@
             target_branch.pull(source_branch)
             no_rebase = True
         else:
-            revid_map, fileid_map = target_branch.dpull(source_branch)
+            revid_map = target_branch.dpull(source_branch)
         # We successfully created the target, remember it
         if source_branch.get_push_location() is None or remember:
             source_branch.set_push_location(target_branch.base)

=== modified file 'tests/test_push.py'
--- a/tests/test_push.py	2008-12-08 20:28:13 +0000
+++ b/tests/test_push.py	2008-12-08 20:48:20 +0000
@@ -114,7 +114,7 @@
         wt.add(["foo/bliel"])
         newid2 = wt.commit(message="Commit from Bzr")
 
-        revid_map, fileid_map = dpush(self.svndir.open_branch(), self.bzrdir.open_branch())
+        revid_map = dpush(self.svndir.open_branch(), self.bzrdir.open_branch())
 
         self.assertEquals(set([newid1, newid2]), set(revid_map.keys()))
         repos = self.svndir.find_repository()




More information about the bazaar-commits mailing list