Remove LogWalker.touches_path.
authorJelmer Vernooij <jelmer@samba.org>
Thu, 27 Mar 2008 01:59:55 +0000 (02:59 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Thu, 27 Mar 2008 01:59:55 +0000 (02:59 +0100)
branchprops.py
logwalker.py
tests/test_logwalker.py

index 77125c06628d2c763ae5d00f17cbf0ac78b0c997..64d2b50215d739f1590fd1fafccfb34e23a5e14b 100644 (file)
@@ -58,7 +58,7 @@ class PathPropertyProvider:
         """
         assert isinstance(revnum, int)
         assert isinstance(path, str)
-        if not self.log.touches_path(path, revnum):
+        if not path in self.log.get_revision_paths(revnum):
             return {}
         current = self.get_properties(path, revnum)
         if current == {}:
@@ -80,7 +80,7 @@ class PathPropertyProvider:
         assert isinstance(path, str)
         # If the path this property is set on didn't change, then 
         # the property can't have changed.
-        if not self.log.touches_path(path, revnum):
+        if not path in self.log.get_revision_paths(revnum):
             return ""
 
         current = self.get_properties(path, revnum).get(name, "")
index e99ad9c3774df9661044c6899106ac0433e8acd7..7a52e8eb7391f06979201e3cb5cb7e01bb38ee0f 100644 (file)
@@ -262,18 +262,6 @@ class LogWalker(object):
 
         return row[0]
 
-    def touches_path(self, path, revnum):
-        """Check whether path was changed in specified revision.
-
-        :param path:  Path to check
-        :param revnum:  Revision to check
-        """
-        self.fetch_revisions(revnum)
-        self.mutter("touches path %r:%r" % (path, revnum))
-        if revnum == 0:
-            return (path == "")
-        return (self.db.execute("select 1 from changed_path where path='%s' and rev=%d" % (path, revnum)).fetchone() is not None)
-
     def find_children(self, path, revnum):
         """Find all children of path in revnum.
 
index 2425f521896f84045537ba8ffc7e2fd80fe322df..45cb9cf8fc2258a5051343c9f9133f40c4f121de 100644 (file)
@@ -377,48 +377,6 @@ class TestLogWalker(TestCaseWithSubversionRepository):
                           ('trunk', {'trunk/afile': ('A', None, -1), 
                                      'trunk': (u'A', None, -1)}, 1)], items)
 
-    def test_touches_path(self):
-        repos_url = self.make_client("a", "dc")
-        self.build_tree({'dc/trunk/afile': "data"})
-        self.client_add("dc/trunk")
-        self.client_commit("dc", "My Message")
-
-        walker = logwalker.LogWalker(transport=SvnRaTransport(repos_url))
-
-        self.assertTrue(walker.touches_path("trunk", 1))
-
-    def test_touches_path_null(self):
-        repos_url = self.make_client("a", "dc")
-        self.build_tree({'dc/trunk/afile': "data"})
-        self.client_add("dc/trunk")
-        self.client_commit("dc", "My Message")
-
-        walker = logwalker.LogWalker(transport=SvnRaTransport(repos_url))
-
-        self.assertTrue(walker.touches_path("", 0))
-
-    def test_touches_path_not(self):
-        repos_url = self.make_client("a", "dc")
-        self.build_tree({'dc/trunk/afile': "data"})
-        self.client_add("dc/trunk")
-        self.client_commit("dc", "My Message")
-
-        walker = logwalker.LogWalker(transport=SvnRaTransport(repos_url))
-
-        self.assertFalse(walker.touches_path("", 1))
-
-    def test_touches_path_child(self):
-        repos_url = self.make_client("a", "dc")
-        self.build_tree({'dc/trunk/afile': "data"})
-        self.client_add("dc/trunk")
-        self.client_commit("dc", "My Message")
-        self.build_tree({'dc/trunk/afile': "data2"})
-        self.client_commit("dc", "My Message")
-
-        walker = logwalker.LogWalker(transport=SvnRaTransport(repos_url))
-
-        self.assertFalse(walker.touches_path("trunk", 2))
-
     def test_get_previous_root(self):
         repos_url = self.make_client("a", "dc")