Rev 1263: Fix failures. in http://people.samba.org/bzr/jelmer/bzr-svn/svn-1.5

Jelmer Vernooij jelmer at samba.org
Mon Jul 21 21:09:14 BST 2008


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

------------------------------------------------------------
revno: 1263
revision-id: jelmer at samba.org-20080721200913-081k6lixwxtt8g2t
parent: jelmer at samba.org-20080721195611-xmm0tffdmmwooye9
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: svn-1.5
timestamp: Mon 2008-07-21 22:09:13 +0200
message:
  Fix failures.
modified:
  logwalker.py                   logwalker.py-20060621215743-c13fhfnyzh1xzwh2-1
=== modified file 'logwalker.py'
--- a/logwalker.py	2008-07-21 19:56:11 +0000
+++ b/logwalker.py	2008-07-21 20:09:13 +0000
@@ -145,54 +145,20 @@
         path was added or replaced, or None if the path was neither added nor
         replaced after from_revnum but before to_revnum.
         """
-        assert from_revnum >= 0 and to_revnum >= 0
-
-        ascending = (to_revnum > from_revnum)
-
-        revnum = from_revnum
-
-        self.mutter("iter changes %r->%r (%r)", from_revnum, to_revnum, paths)
-
-        if paths is None:
-            path = ""
-        else:
-            assert len(paths) == 1
-            path = paths[0].strip("/")
-
-        assert from_revnum >= to_revnum or path == ""
-
-        self.fetch_revisions(max(from_revnum, to_revnum))
-        i = 0
-
-        while ((not ascending and revnum >= to_revnum) or
-               (ascending and revnum <= to_revnum)):
-            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)
-
-            if ascending:
-                next = (path, revnum+1)
-            else:
-                next = changes.find_prev_location(revpaths, path, revnum)
-
-            revprops = lazy_dict({}, self.revprop_list, revnum)
-
-            if changes.changes_path(revpaths, path, True):
-                assert isinstance(revnum, int)
-                yield (revpaths, revnum, revprops)
-                i += 1
-                if limit != 0 and i == limit:
-                    break
-
-            if next is None:
-                break
-
-            assert (ascending and next[1] > revnum) or \
-                   (not ascending and next[1] < revnum)
-            (path, revnum) = next
-            assert isinstance(path, str)
-            assert isinstance(revnum, int)
+        assert from_revnum < to_revnum
+        return self.cachedb.execute("""
+            select max(rev) from changed_path
+            where rev > ? and rev <= ?
+            and (?=path or ? glob (path || '/*'))
+            and action in ('A', 'R')
+        """, (from_revnum, to_revnum, path, path)).fetchone()[0]
+
+    def get_change(self, path, revnum):
+        return self.cachedb.execute("""
+            select action, copyfrom_path, copyfrom_rev
+            from changed_path
+            where path=? and rev=?
+            """, (path, revnum)).fetchone()
 
     def get_previous(self, path, revnum):
         """Determine the change that created the given path or its
@@ -758,7 +724,7 @@
                     continue
                 raise
 
-    def _cache_revisions_range(self, from_revnum, to_revnum, path):
+    def _cache_revisions_range(self, path, from_revnum, to_revnum):
         """Request the log information and store it in the cache table."""
         if self._transport.has_capability("log-revprops"):
             todo_revprops = None
@@ -783,7 +749,10 @@
             self.cache.insert_revinfo(revision, todo_revprops is None)
             self.cache.commit_conditionally()
 
-        url = urlutils.join(self._transport.get_svn_repos_root(), path)
+        assert type(path) == str, "path is %r" % path
+        repos_root = self._transport.get_svn_repos_root()
+        assert type(repos_root) == str
+        url = urlutils.join(repos_root, path)
         self.mutter("Fetching revisions %d:%d from %r (%r)", from_revnum, to_revnum, path, url)
         pb = ui.ui_factory.nested_progress_bar()
         try:




More information about the bazaar-commits mailing list