Commits

Christian Boos  committed 60f112e

0.10.4dev: ported r4997 to stable (''fix has_node method, #4830'')

  • Participants
  • Parent commits c47f4f2
  • Branches 0.10-stable

Comments (0)

Files changed (3)

File trac/versioncontrol/cache.py

     def get_node(self, path, rev=None):
         return self.repos.get_node(path, rev)
 
-    def has_node(self, path, rev):
+    def has_node(self, path, rev=None):
         return self.repos.has_node(path, rev)
 
     def get_oldest_rev(self):

File trac/versioncontrol/svn_fs.py

     def __del__(self):
         self.close()
 
-    def has_node(self, path, rev, pool=None):
+    def has_node(self, path, rev=None, pool=None):
         if not pool:
             pool = self.pool
+        rev = self.normalize_rev(rev)
         rev_root = fs.revision_root(self.fs_ptr, rev, pool())
         node_type = fs.check_path(rev_root, _to_svn(self.scope, path), pool())
         return node_type in _kindmap

File trac/versioncontrol/tests/svn_fs.py

     def test_has_node(self):
         self.assertEqual(False, self.repos.has_node('/trunk/dir1', 3))
         self.assertEqual(True, self.repos.has_node('/trunk/dir1', 4))
+        self.assertEqual(True, self.repos.has_node('/trunk/dir1'))
         
     def test_get_node(self):
         node = self.repos.get_node('/trunk')