Rev 1744: parents cache tests. in file:///data/jelmer/bzr-svn/trunk/

Jelmer Vernooij jelmer at samba.org
Sun Aug 31 23:09:22 BST 2008


At file:///data/jelmer/bzr-svn/trunk/

------------------------------------------------------------
revno: 1744
revision-id: jelmer at samba.org-20080831220920-65r210js1hsxkqtx
parent: jelmer at samba.org-20080831200501-fn85tu9v7ng075k5
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Mon 2008-09-01 00:09:20 +0200
message:
  parents cache tests.
modified:
  TODO                           todo-20060729211917-2kpobww0zyvvo0j2-1
  parents.py                     parents.py-20080505192113-5rcif033d6wcam9w-1
  tests/__init__.py              __init__.py-20060508151940-e9f4d914801a2535
=== modified file 'TODO'
--- a/TODO	2008-08-31 17:34:49 +0000
+++ b/TODO	2008-08-31 22:09:20 +0000
@@ -18,9 +18,7 @@
 .svn working trees:
 - implement apply_inventory_delta()
 
-
 - Needs more tests
- - parents cache
  - Run all tests against repository with revprop changing allowed and without
 - Needs upgrade command that can use legacy file properties and set revprops
 - Support disabling legacy file property support somehow

=== modified file 'parents.py'
--- a/parents.py	2008-08-23 14:55:24 +0000
+++ b/parents.py	2008-08-31 22:09:20 +0000
@@ -20,6 +20,8 @@
 from bzrlib.versionedfile import ConstantMapper
 
 class DiskCachingParentsProvider(object):
+    """Parents provider that caches parents in a SQLite database."""
+
     def __init__(self, actual, cachetransport):
         self._cache = ParentsCache(cachetransport)
         self.actual = actual
@@ -33,7 +35,7 @@
                 todo.add(k)
             else:
                 ret[k] = parents
-        if len(todo):
+        if len(todo) > 0:
             newfound = self.actual.get_parent_map(todo)
             for revid, parents in newfound.items():
                 if revid == NULL_REVISION:

=== modified file 'tests/__init__.py'
--- a/tests/__init__.py	2008-08-31 15:31:04 +0000
+++ b/tests/__init__.py	2008-08-31 22:09:20 +0000
@@ -326,6 +326,7 @@
             'test_log',
             'test_logwalker',
             'test_mapping',
+            'test_parents',
             'test_properties',
             'test_push',
             'test_ra',




More information about the bazaar-commits mailing list