Rev 1241: Avoid use of stock python bindings. in file:///data/jelmer/bzr-svn/svn-1.5/

Jelmer Vernooij jelmer at samba.org
Sun Jun 22 15:32:25 BST 2008


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

------------------------------------------------------------
revno: 1241
revision-id: jelmer at samba.org-20080622143224-8rysv01ocmmnac22
parent: jelmer at samba.org-20080622140106-1143ouptxiwik0p2
parent: jelmer at samba.org-20080622143150-u6rouaak2ejz0quq
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: svn-1.5
timestamp: Sun 2008-06-22 16:32:24 +0200
message:
  Avoid use of stock python bindings.
modified:
  logwalker.py                   logwalker.py-20060621215743-c13fhfnyzh1xzwh2-1
  setup.py                       setup.py-20060502115218-86950492da22353f
    ------------------------------------------------------------
    revno: 1196.1.76
    revision-id: jelmer at samba.org-20080622143150-u6rouaak2ejz0quq
    parent: jelmer at samba.org-20080622140033-us0bh43lcatmqh8o
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sun 2008-06-22 16:31:50 +0200
    message:
      Deal with apr flags being empty.
    modified:
      setup.py                       setup.py-20060502115218-86950492da22353f
=== modified file 'logwalker.py'
--- a/logwalker.py	2008-06-22 13:47:30 +0000
+++ b/logwalker.py	2008-06-22 14:32:24 +0000
@@ -641,7 +641,7 @@
                 self._fetch_revisions3(path, from_revnum, to_revnum)
                 return path
             except SubversionException, (_, num):
-                if num == svn.core.SVN_ERR_FS_NO_SUCH_REVISION:
+                if num == ERR_FS_NO_SUCH_REVISION:
                     raise NoSuchRevision(branch=self, 
                         revision="Revision number %d" % to_revnum)
                 if num == ERR_FS_NOT_FOUND and path != "":
@@ -655,24 +655,19 @@
         """Revision fetching level 3: Actually request the log
         information and store it in the cache table."""
         
-        def rcvr(log_entry, pool):
-            orig_paths = log_entry.changed_paths
-            revision = log_entry.revision
-            revprops = log_entry.revprops
+        def rcvr(orig_paths, revision, revprops):
             pb.update('fetching svn revision info', revision - from_revnum + 1, to_revnum - from_revnum + 1)
             if orig_paths is None:
                 orig_paths = {}
             for p in orig_paths:
-                copyfrom_path = orig_paths[p].copyfrom_path
+                copyfrom_path = orig_paths[p][1]
                 if copyfrom_path is not None:
                     copyfrom_path = copyfrom_path.strip("/")
-                self.cache.insert(revision, p.strip("/"), orig_paths[p].action,
-                                  copyfrom_path, orig_paths[p].copyfrom_rev)
+                self.cache.insert(revision, p.strip("/"), orig_paths[p][0],
+                                  copyfrom_path, orig_paths[p][2])
                 self.mutter("rev=%r, path=%r, action=%r, copyfrom_path=%r, copyfrom_rev=%r",
-                            revision, p.strip("/"), orig_paths[p].action,
-                            copyfrom_path, orig_paths[p].copyfrom_rev)
-                # Work around nasty memory leak in Subversion
-                orig_paths[p]._parent_pool.destroy()
+                            revision, p.strip("/"), orig_paths[p][0],
+                            copyfrom_path, orig_paths[p][2])
 
         url = urlutils.join(self._transport.get_svn_repos_root(), path)
         self.mutter("Fetching revisions %d:%d from %r (%r)", from_revnum, to_revnum, path, url)
@@ -680,8 +675,8 @@
         try:
             pb.update('fetching svn revision info', 0, to_revnum - from_revnum + 1)
             conn = self._transport.connections.get(url)
-            conn.get_log(rcvr=rcvr, paths=[""],
-                         from_revnum=from_revnum, to_revnum=to_revnum, limit=0,
+            conn.get_log(rcvr, [""],
+                         from_revnum, to_revnum, 
                          discover_changed_paths=True, strict_node_history=False, revprops=[])
             self.cache.commit()
         finally:

=== modified file 'setup.py'
--- a/setup.py	2008-06-22 14:00:33 +0000
+++ b/setup.py	2008-06-22 14:31:50 +0000
@@ -15,7 +15,7 @@
     includedir = apr_config("--includedir")
     if not os.path.isdir(includedir):
         raise Exception("APR development headers not found")
-    ldflags = apr_config("--ldflags")
+    ldflags = filter(lambda x: x != "", apr_config("--ldflags").split(" "))
     return (includedir, ldflags)
 
 def svn_build_data():
@@ -33,7 +33,7 @@
 def SvnExtension(*args, **kwargs):
     kwargs["include_dirs"] = [apr_includedir, svn_includedir]
     kwargs["library_dirs"] = [svn_libdir]
-    kwargs["extra_link_args"] = [apr_ldflags]
+    kwargs["extra_link_args"] = apr_ldflags
     return Extension(*args, **kwargs)
 
 




More information about the bazaar-commits mailing list