Avoid using get_revision_paths().
authorJelmer Vernooij <jelmer@samba.org>
Sun, 23 Mar 2008 23:53:30 +0000 (00:53 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 23 Mar 2008 23:53:30 +0000 (00:53 +0100)
fetch.py
logwalker.py
repository.py

index eb910cf2d743572f76d2a76fca7496aa5c3fcf0b..015f7ee45ef6acc79acfe83365bb5954a90cbb45 100644 (file)
--- a/fetch.py
+++ b/fetch.py
@@ -570,7 +570,7 @@ class InterFromSvnRepository(InterRepository):
                 elif not find_ghosts:
                     break
         else:
-r           for (revid, parent_revid) in graph.iter_lhs_ancestry(revision_id):
+            for (revid, parent_revid) in graph.iter_lhs_ancestry(revision_id):
                 if revid == NULL_REVISION:
                     continue
                 parents[revid] = (parent_revid,)
index b437d76466448f254c38f29b62d1d2c808dbf834..a07a99310a88d35cbb652ea2566fd5e10cd9f660 100644 (file)
@@ -39,6 +39,9 @@ def changes_find_prev_location(paths, branch_path, revnum):
     # next revnum in history
     revnum -= 1
 
+    if branch_path == "":
+        return (branch_path, revnum)
+
     # Make sure we get the right location for next time, if 
     # the branch itself was copied
     if (paths.has_key(branch_path) and 
@@ -69,10 +72,6 @@ def changes_find_prev_location(paths, branch_path, revnum):
     return (branch_path, revnum)
 
 
-
-
-
-
 class LogWalker(object):
     """Easy way to access the history of a Subversion repository."""
     def __init__(self, transport, cache_db=None, limit=None):
@@ -182,7 +181,7 @@ class LogWalker(object):
         if revnum == 0 and path == "":
             return
 
-        self.mutter("follow path %r:%r" % (path, revnum))
+        self.mutter("iter changes %r:%r" % (path, revnum))
 
         recurse = (path != "")
 
index 3ddf455474410a07e46868cf608ac3e02cd0423e..67d2d26ac0ebe95b3a3bcd3f838ea1fd80d46f43 100644 (file)
@@ -690,9 +690,8 @@ class SvnRepository(Repository):
         """
         assert mapping is not None
 
-        while revnum >= 0:
+        for (_, paths, revnum) in self._log.iter_changes("", revnum):
             yielded_paths = []
-            paths = self._log.get_revision_paths(revnum)
             for p in paths:
                 try:
                     bp = mapping.scheme.unprefix(p)[0]
@@ -703,7 +702,6 @@ class SvnRepository(Repository):
                         yielded_paths.append(bp)
                 except NotBranchError:
                     pass
-            revnum -= 1
 
     def get_lhs_parent(self, revid):
         (branch_path, revnum, mapping) = self.lookup_revision_id(revid)