Rev 320: Remove if statement again. This fixes importing several repositories. in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev

Jelmer Vernooij jelmer at samba.org
Thu Dec 28 04:47:38 GMT 2006


------------------------------------------------------------
revno: 320
revision-id: jelmer at samba.org-20061228044650-1hvjud25we4tb4tr
parent: jelmer at samba.org-20061228034106-zflnscoxd7l2x6wt
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Thu 2006-12-28 05:46:50 +0100
message:
  Remove if statement again. This fixes importing several repositories. 
modified:
  logwalker.py                   logwalker.py-20060621215743-c13fhfnyzh1xzwh2-1
  tests/test_repos.py            test_repos.py-20060508151940-ddc49a59257ca712
=== modified file 'logwalker.py'
--- a/logwalker.py	2006-12-26 23:37:35 +0000
+++ b/logwalker.py	2006-12-28 04:46:50 +0000
@@ -264,11 +264,10 @@
             yield os.path.join(path, p)
             # This needs to be != svn.core.svn_node_file because 
             # some ra backends seem to return negative values for .kind.
-            # This if statement is just an optimization to make use of this 
-            # property when possible.
-            if dirents[p].kind != svn.core.svn_node_file:
-                for c in self.find_children(os.path.join(path, p), revnum):
-                    yield c
+            # however, dirents[p].node seems to contain semi-random 
+            # values.
+            for c in self.find_children(os.path.join(path, p), revnum):
+                yield c
 
     def get_previous(self, path, revnum):
         """Return path,revnum pair specified pair was derived from.

=== modified file 'tests/test_repos.py'
--- a/tests/test_repos.py	2006-12-27 03:05:23 +0000
+++ b/tests/test_repos.py	2006-12-28 04:46:50 +0000
@@ -548,6 +548,22 @@
                 "svn-v%d:2@%s-" % (MAPPING_VERSION, oldrepos.uuid))
         self.assertNotEqual(inv1.path2id("bla"), inv2.path2id("bla"))
 
+    def test_fetch_copy_subdir(self):
+        repos_url = self.make_client('d', 'dc')
+        self.build_tree({'dc/trunk/mydir/a': "data"})
+        self.client_add("dc/trunk")
+        self.client_commit("dc", "My Message")
+        self.build_tree({'dc/branches/tmp': None})
+        self.client_add("dc/branches")
+        self.client_commit("dc", "Second Message")
+        self.client_copy("dc/trunk/mydir", "dc/branches/tmp/abranch")
+        self.client_commit("dc", "Third Message")
+        oldrepos = Repository.open("svn+"+repos_url)
+        oldrepos.set_branching_scheme(TrunkBranchingScheme())
+        dir = BzrDir.create("f")
+        newrepos = dir.create_repository()
+        oldrepos.copy_content_into(newrepos)
+
     def test_fetch_replace_with_subreplace(self):
         filename = os.path.join(self.test_dir, "dumpfile")
         open(filename, 'w').write("""SVN-fs-dump-format-version: 2




More information about the bazaar-commits mailing list