Rev 712: Support NULL_REVISION being passed to copy_contnet(). in file:///data/jelmer/bzr-svn/0.4/

Jelmer Vernooij jelmer at samba.org
Mon Sep 24 06:18:08 BST 2007


At file:///data/jelmer/bzr-svn/0.4/

------------------------------------------------------------
revno: 712
revision-id: jelmer at samba.org-20070923232745-dnzeidfrpch11l3g
parent: jelmer at samba.org-20070920192859-5tej7js5bal4d2b2
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Mon 2007-09-24 01:27:45 +0200
message:
  Support NULL_REVISION being passed to copy_contnet().
modified:
  NEWS                           news-20061231030336-h9fhq245ie0de8bs-1
  fetch.py                       fetch.py-20060625004942-x2lfaib8ra707a8p-1
  tests/test_fetch.py            test_fetch.py-20070624210302-luvgwjmlfysk5qeq-1
=== modified file 'NEWS'
--- a/NEWS	2007-09-19 12:50:40 +0000
+++ b/NEWS	2007-09-23 23:27:45 +0000
@@ -9,6 +9,11 @@
    
    * Avoid tracebacks on "Malformed data" errors.
 
+  INTERNALS
+
+   * Handle NULL_REVISION in SvnRepository.copy_content(). Fixes compatibility 
+     with bzr merge-into.
+
 bzr-svn 0.4.3	2007-09-15
  
   PERFORMANCE

=== modified file 'fetch.py'
--- a/fetch.py	2007-09-13 21:21:23 +0000
+++ b/fetch.py	2007-09-23 23:27:45 +0000
@@ -18,7 +18,7 @@
 import bzrlib
 from bzrlib import osutils, ui, urlutils
 from bzrlib.inventory import Inventory
-from bzrlib.revision import Revision
+from bzrlib.revision import Revision, NULL_REVISION
 from bzrlib.repository import InterRepository
 from bzrlib.trace import mutter
 
@@ -408,6 +408,8 @@
 
     def copy_content(self, revision_id=None, pb=None):
         """See InterRepository.copy_content."""
+        if revision_id == NULL_REVISION:
+            return
         # Dictionary with paths as keys, revnums as values
 
         # Loop over all the revnums until revision_id

=== modified file 'tests/test_fetch.py'
--- a/tests/test_fetch.py	2007-09-17 13:18:46 +0000
+++ b/tests/test_fetch.py	2007-09-23 23:27:45 +0000
@@ -19,6 +19,7 @@
 from bzrlib.branch import Branch
 from bzrlib.bzrdir import BzrDir
 from bzrlib.repository import Repository
+from bzrlib.revision import NULL_REVISION
 from bzrlib.trace import mutter
 
 from convert import load_dumpfile
@@ -58,6 +59,14 @@
         newrepos = dir.create_repository()
         oldrepos.copy_content_into(newrepos)
 
+    def test_fetch_null(self):
+        repos_url = self.make_client('d', 'dc')
+        oldrepos = Repository.open(repos_url)
+        oldrepos.set_branching_scheme(TrunkBranchingScheme(1))
+        dir = BzrDir.create("f", format.get_rich_root_format())
+        newrepos = dir.create_repository()
+        oldrepos.copy_content_into(newrepos, NULL_REVISION)
+
     def test_fetch_complex_ids_dirs(self):
         repos_url = self.make_client('d', 'dc')
         self.build_tree({'dc/dir/adir': None})




More information about the bazaar-commits mailing list