Support NULL_REVISION being passed to copy_contnet().
authorJelmer Vernooij <jelmer@samba.org>
Sun, 23 Sep 2007 23:27:45 +0000 (01:27 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 23 Sep 2007 23:27:45 +0000 (01:27 +0200)
NEWS
fetch.py
tests/test_fetch.py

diff --git a/NEWS b/NEWS
index b8837d8ff2954e8d49ee9ef6926aed2dca3d7cd9..d64ef9d3343a01457c432b151c163c5b33c93647 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,11 @@ bzr-svn 0.4.4  UNRELEASED
    
    * 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
index 0d59401231222232059ada52a5fe15687a20fe6c..5c4c8c8ad562f04fa81f608a0a4a29e43cd8b64f 100644 (file)
--- a/fetch.py
+++ b/fetch.py
@@ -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 @@ class InterFromSvnRepository(InterRepository):
 
     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
index bd6ed2f054ea98d86d0954b78038d5190da080f1..c8d4daad9c5072794014ffbcaacee3a4cd97ba11 100644 (file)
@@ -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 @@ class TestFetchWorks(TestCaseWithSubversionRepository):
         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})