Fix the build.
authorJelmer Vernooij <jelmer@samba.org>
Thu, 13 Sep 2007 03:18:20 +0000 (05:18 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Thu, 13 Sep 2007 03:18:20 +0000 (05:18 +0200)
logwalker.py
repository.py
tests/test_logwalker.py
tests/test_repos.py

index bf60b43d029893cd403a685006fc9ecbbb3fab57..0d767837340ff756a2e72a47294361f2f8d6c902 100644 (file)
@@ -18,6 +18,7 @@
 from bzrlib import urlutils
 from bzrlib.errors import NoSuchRevision
 import bzrlib.ui as ui
+from copy import copy
 
 from svn.core import SubversionException, Pool
 from transport import SvnRaTransport
@@ -159,7 +160,7 @@ class LogWalker(object):
             revpaths = self.get_revision_paths(revnum, path, recurse=recurse)
 
             if revpaths != {}:
-                yield (path, revpaths, revnum)
+                yield (path, copy(revpaths), revnum)
 
             if path == "":
                 revnum -= 1
@@ -185,7 +186,7 @@ class LogWalker(object):
                     revnum = revpaths[p][2]
                     break
 
-    def get_revision_paths(self, revnum, path=None, recurse=True):
+    def get_revision_paths(self, revnum, path=None, recurse=False):
         """Obtain dictionary with all the changes in a particular revision.
 
         :param revnum: Subversion revision number
index 3902e811321f00c7b1344a8a9e95f6bc322379f3..628d7ed51d09c01478fd362606633fb864e7737c 100644 (file)
@@ -918,6 +918,15 @@ class SvnRepository(Repository):
 
         for (bp, paths, revnum) in self._log.follow_path(branch_path, revnum):
             assert revnum > 0 or bp == ""
+            assert scheme.is_branch(bp) or schee.is_tag(bp)
+            # Remove non-bp paths from paths
+            for p in paths.keys():
+                if not p.startswith(bp+"/") and bp != p and bp != "":
+                    del paths[p]
+
+            if paths == {}:
+                continue
+
             if (paths.has_key(bp) and paths[bp][1] is not None and 
                 not scheme.is_branch(paths[bp][1]) and
                 not scheme.is_tag(paths[bp][1])):
index 718bfec369ced6bc5b76ad64d3f6b70f0597fdc2..485c88eb8d075d2e127af29ac5db9dde45161846 100644 (file)
@@ -93,7 +93,7 @@ class TestLogWalker(TestCaseWithSubversionRepository):
         walker = logwalker.LogWalker(SvnRaTransport(repos_url))
         self.assertEqual({"foo": ('A', None, -1)}, walker.get_revision_paths(1))
         self.assertEqual({"foo": ('A', None, -1)}, walker.get_revision_paths(1, "foo"))
-        self.assertEqual({"": ('A', None, -1)}, walker.get_revision_paths(0, "foo"))
+        self.assertEqual({"": ('A', None, -1)}, walker.get_revision_paths(0, ""))
 
     def test_get_revision_paths_zero(self):
         repos_url = self.make_client("a", "dc")
index 4f8ef64691d70d36a5b6b879d360807ae84de139..023456906d6cc8a1daa5a568183888317511c805 100644 (file)
@@ -62,8 +62,10 @@ class TestSubversionRepositoryWorks(TestCaseWithSubversionRepository):
 
         repos = Repository.open(repos_url)
 
-        self.assertEqual(2, 
-             len(list(repos.follow_branch_history("", 1, NoBranchingScheme()))))
+        self.assertEqual([
+            ('', {'foo': ('A', None, -1)}, 1), 
+            ('', {'': ('A', None, -1)}, 0)],
+             list(repos.follow_branch_history("", 1, NoBranchingScheme())))
 
     def test_make_working_trees(self):
         repos_url = self.make_client("a", "dc")