Rev 1485: Make get_revision_paths private. in http://people.samba.org/bzr/jelmer/bzr-svn/trunk

Jelmer Vernooij jelmer at samba.org
Mon Jul 21 21:46:24 BST 2008


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

------------------------------------------------------------
revno: 1485
revision-id: jelmer at samba.org-20080721204623-0q57gn7cyjr3nqzm
parent: jelmer at samba.org-20080721202804-9619h2v4r9q6pynq
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Mon 2008-07-21 22:46:23 +0200
message:
  Make get_revision_paths private.
modified:
  branchprops.py                 branchprops.py-20061223204623-80lvm7pjrpsgk0dd-1
  logwalker.py                   logwalker.py-20060621215743-c13fhfnyzh1xzwh2-1
  tests/test_logwalker.py        test_logwalker.py-20060622141944-pkocc3rj8g62ukbi-1
=== modified file 'branchprops.py'
--- a/branchprops.py	2008-06-15 02:11:24 +0000
+++ b/branchprops.py	2008-07-21 20:46:23 +0000
@@ -58,7 +58,7 @@
         """
         assert isinstance(revnum, int)
         assert isinstance(path, str)
-        if not path in self.log.get_revision_paths(revnum):
+        if self.log.get_change(path, revnum) is None:
             return {}
         current = self.get_properties(path, revnum)
         if current == {}:

=== modified file 'logwalker.py'
--- a/logwalker.py	2008-07-10 01:38:05 +0000
+++ b/logwalker.py	2008-07-21 20:46:23 +0000
@@ -314,7 +314,7 @@
             if pb is not None:
                 pb.update("determining changes", from_revnum-revnum, from_revnum)
             assert revnum > 0 or path == "", "Inconsistent path,revnum: %r,%r" % (revnum, path)
-            revpaths = self.get_revision_paths(revnum)
+            revpaths = self._get_revision_paths(revnum)
 
             if ascending:
                 next = (path, revnum+1)
@@ -365,7 +365,7 @@
             return (None, -1) # newly added
         return (copyfrom_path + path[len(branch_path):], copyfrom_rev)
 
-    def get_revision_paths(self, revnum):
+    def _get_revision_paths(self, revnum):
         if revnum == 0:
             return {'': ('A', None, -1)}
         self.fetch_revisions(revnum)
@@ -380,7 +380,7 @@
         :param revnum:  Revision to check
         """
         assert revnum >= 0
-        self.fetch_revisions(path, revnum)
+        self.fetch_revisions(revnum)
         
         self.mutter("get previous %r:%r", path, revnum)
         if revnum == 0:
@@ -558,7 +558,7 @@
                     revision="Revision number %d" % from_revnum)
             raise
 
-    def get_revision_paths(self, revnum):
+    def _get_revision_paths(self, revnum):
         """Obtain dictionary with all the changes in a particular revision.
 
         :param revnum: Subversion revision number
@@ -579,7 +579,7 @@
             raise
 
     def changes_path(self, path, revnum):
-        return self.get_revision_paths(revnum).has_key(path)
+        return self._get_revision_paths(revnum).has_key(path)
         
     def find_children(self, path, revnum):
         """Find all children of path in revnum.

=== modified file 'tests/test_logwalker.py'
--- a/tests/test_logwalker.py	2008-06-29 23:21:16 +0000
+++ b/tests/test_logwalker.py	2008-07-21 20:46:23 +0000
@@ -90,25 +90,6 @@
                            "trunk": ('A', None, -1)}, 1)
             ], [l[:2] for l in walker.iter_changes(["branches/abranch/foo"], 3)])
 
-    def test_get_revision_paths(self):
-        repos_url = self.make_repository("a")
-        cb = self.get_commit_editor(repos_url)
-        cb.add_file("foo").modify()
-        cb.close()
-        walker = self.get_log_walker(SvnRaTransport(repos_url))
-        self.assertEqual({"foo": ('A', None, -1)}, walker.get_revision_paths(1))
-        self.assertEqual({"": ('A', None, -1)}, walker.get_revision_paths(0))
-
-    def test_get_revision_paths_zero(self):
-        repos_url = self.make_repository("a")
-        walker = self.get_log_walker(SvnRaTransport(repos_url))
-        self.assertEqual({'': ('A', None, -1)}, walker.get_revision_paths(0))
-
-    def test_get_revision_paths_invalid(self):
-        repos_url = self.make_repository("a")
-        walker = self.get_log_walker(SvnRaTransport(repos_url))
-        self.assertRaises(NoSuchRevision, lambda: walker.get_revision_paths(42))
-
     def test_get_branch_invalid_revision(self):
         repos_url = self.make_repository("a")
         walker = self.get_log_walker(transport=SvnRaTransport(repos_url))
@@ -666,32 +647,6 @@
                           'trunk/db/f1', 'trunk/db/f2']), 
                 set(walker.find_children("trunk", 3)))
 
-    def test_fetch_property_change_only_trunk(self):
-        repos_url = self.make_repository('d')
-
-        cb = self.get_commit_editor(repos_url)
-        t = cb.add_dir("trunk")
-        t.add_file("trunk/bla").modify()
-        cb.close()
-
-        cb = self.get_commit_editor(repos_url)
-        t = cb.open_dir("trunk")
-        t.change_prop("some:property", "some data\n")
-        cb.close()
-
-        cb = self.get_commit_editor(repos_url)
-        t = cb.open_dir("trunk")
-        t.change_prop("some2:property", "some data\n")
-        cb.close()
-
-        cb = self.get_commit_editor(repos_url)
-        t = cb.open_dir("trunk")
-        t.change_prop("some:property", "some data4\n")
-        cb.close()
-
-        walker = self.get_log_walker(transport=SvnRaTransport(repos_url))
-        self.assertEquals({'trunk': ('M', None, -1)}, walker.get_revision_paths(3))
-
     def test_iter_changes_property_change(self):
         repos_url = self.make_repository('d')
 




More information about the bazaar-commits mailing list