Rev 1254: Remove checks for Subversion version, adapt code to use the new C-basd API. in file:///data/jelmer/bzr-svn/0.4-ra-cext/
Jelmer Vernooij
jelmer at samba.org
Sat Jun 21 22:47:35 BST 2008
At file:///data/jelmer/bzr-svn/0.4-ra-cext/
------------------------------------------------------------
revno: 1254
revision-id: jelmer at samba.org-20080621214734-8xwpe5pej1blrnj3
parent: jelmer at samba.org-20080621214404-nlo0nm99vm8ju1or
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4-ra-cext
timestamp: Sat 2008-06-21 23:47:34 +0200
message:
Remove checks for Subversion version, adapt code to use the new C-basd API.
modified:
__init__.py __init__.py-20051008155114-eae558e6cf149e1d
auth.py auth.py-20071209174622-w8d42k6nm5yhxvi8-1
branch.py svnbranch.py-20051017135706-11c749eb0dab04a7
logwalker.py logwalker.py-20060621215743-c13fhfnyzh1xzwh2-1
setup.py setup.py-20060502115218-86950492da22353f
tests/__init__.py __init__.py-20060508151940-e9f4d914801a2535
tree.py tree.py-20060624222557-dudlwqcmkf22lt2s-1
workingtree.py workingtree.py-20060306120941-b083cb0fdd4a69de
=== modified file '__init__.py'
--- a/__init__.py 2008-06-19 13:58:42 +0000
+++ b/__init__.py 2008-06-21 21:47:34 +0000
@@ -68,23 +68,12 @@
"""Check that Subversion is compatible.
"""
- try:
- import svn.delta
- except ImportError:
- warning('No Python bindings for Subversion installed. See the '
- 'bzr-svn README for details.')
- raise bzrlib.errors.BzrError("missing python subversion bindings")
- if (not getattr(svn.delta, 'svn_delta_invoke_txdelta_window_handler', None) and
- not getattr(svn.delta, 'tx_invoke_window_handler', None)):
- warning('Installed Subversion version does not have updated Python '
- 'bindings. See the bzr-svn README for details.')
- raise bzrlib.errors.BzrError("incompatible python subversion bindings")
- import svn.core
- if (svn.core.SVN_VER_MINOR >= 5 and
- 27729 <= svn.core.SVN_VER_REVISION < 31470):
+ from bzrlib.plugins.svn.ra import version
+ ra_version = version()
+ if (ra_version[0] >= 5 and getattr(ra, 'SVN_REVISION', None) and 27729 <= ra.SVN_REVISION < 31470):
warning('Installed Subversion has buggy svn.ra.get_log() implementation, please install newer.')
- mutter("bzr-svn: using Subversion %d.%d.%d (%s)", svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR, svn.core.SVN_VER_MICRO, svn.core.__file__)
+ mutter("bzr-svn: using Subversion %d.%d.%d (%s)" % ra_version)
def check_rebase_version(min_version):
=== modified file 'auth.py'
--- a/auth.py 2008-06-21 16:05:10 +0000
+++ b/auth.py 2008-06-21 21:47:34 +0000
@@ -179,4 +179,4 @@
auth_baton.set_parameter(AUTH_PARAM_DEFAULT_USERNAME, user)
if password is not None:
auth_baton.set_parameter(AUTH_PARAM_DEFAULT_PASSWORD, password)
- return auth_baton.auth_baton
+ return auth_baton
=== modified file 'branch.py'
--- a/branch.py 2008-06-21 20:44:24 +0000
+++ b/branch.py 2008-06-21 21:47:34 +0000
@@ -27,6 +27,7 @@
import svn.core
from bzrlib.plugins.svn import core
+from bzrlib.plugins.svn.auth import create_auth_baton
from bzrlib.plugins.svn.client import Client
from bzrlib.plugins.svn.commit import push
from bzrlib.plugins.svn.config import BranchConfig
@@ -184,7 +185,7 @@
rev = self.lookup_revision_id(revision_id)
svn_url = bzr_to_svn_url(self.base)
- client_ctx = Client(svn_url)
+ client_ctx = Client(auth=create_auth_baton(svn_url))
client_ctx.checkout(svn_url, to_location, rev, True)
return WorkingTree.open(to_location)
=== modified file 'logwalker.py'
--- a/logwalker.py 2008-06-21 20:44:24 +0000
+++ b/logwalker.py 2008-06-21 21:47:34 +0000
@@ -28,8 +28,6 @@
from bzrlib.plugins.svn.errors import ERR_FS_NO_SUCH_REVISION, ERR_FS_NOT_FOUND
from bzrlib.plugins.svn.transport import SvnRaTransport
-LOG_CHUNK_LIMIT = 0
-
class lazy_dict(object):
def __init__(self, initial, create_fn, *args):
self.initial = initial
@@ -260,24 +258,23 @@
try:
try:
- while self.saved_revnum < to_revnum:
- for (orig_paths, revision, revprops) in self.actual._transport.iter_log(None, self.saved_revnum,
- to_revnum, self.actual._limit, True,
- True, []):
- pb.update('fetching svn revision info', revision, to_revnum)
- if orig_paths is None:
- orig_paths = {}
- for p in orig_paths:
- copyfrom_path = orig_paths[p][1]
- if copyfrom_path is not None:
- copyfrom_path = copyfrom_path.strip("/")
+ for (orig_paths, revision, revprops) in self.actual._transport.iter_log(None, self.saved_revnum,
+ to_revnum, 0, True,
+ True, []):
+ pb.update('fetching svn revision info', revision, to_revnum)
+ if orig_paths is None:
+ orig_paths = {}
+ for p in orig_paths:
+ copyfrom_path = orig_paths[p][1]
+ if copyfrom_path is not None:
+ copyfrom_path = copyfrom_path.strip("/")
- self.cachedb.execute(
- "replace into changed_path (rev, path, action, copyfrom_path, copyfrom_rev) values (?, ?, ?, ?, ?)",
- (revision, p.strip("/"), orig_paths[p][0], copyfrom_path, orig_paths[p][2]))
- self.saved_revnum = revision
- if self.saved_revnum % 1000 == 0:
- self.cachedb.commit()
+ self.cachedb.execute(
+ "replace into changed_path (rev, path, action, copyfrom_path, copyfrom_rev) values (?, ?, ?, ?, ?)",
+ (revision, p.strip("/"), orig_paths[p][0], copyfrom_path, orig_paths[p][2]))
+ self.saved_revnum = revision
+ if self.saved_revnum % 1000 == 0:
+ self.cachedb.commit()
finally:
pb.finished()
except SubversionException, (_, num):
@@ -311,11 +308,6 @@
self._transport = transport
- if limit is not None:
- self._limit = limit
- else:
- self._limit = LOG_CHUNK_LIMIT
-
def find_latest_change(self, path, revnum):
"""Find latest revision that touched path.
=== modified file 'setup.py'
--- a/setup.py 2008-06-21 20:44:24 +0000
+++ b/setup.py 2008-06-21 21:47:34 +0000
@@ -42,7 +42,7 @@
'bzrlib.plugins.svn.mapping3',
'bzrlib.plugins.svn.tests'],
ext_modules=[
- Extension("client", ["client.c", "util.c"], libraries=["svn_client-1"],
+ Extension("client", ["client.c", "util.c", "ra.c", "editor.c"], libraries=["svn_client-1"],
include_dirs=[apr_include_dir(), svn_include_dir()]),
Extension("ra", ["ra.c", "util.c", "editor.c"], libraries=["svn_ra-1"],
include_dirs=[apr_include_dir(), svn_include_dir()]),
=== modified file 'tests/__init__.py'
--- a/tests/__init__.py 2008-06-21 20:44:24 +0000
+++ b/tests/__init__.py 2008-06-21 21:47:34 +0000
@@ -31,9 +31,9 @@
import svn.core
-from bzrlib.plugins.svn import repos
+from bzrlib.plugins.svn import ra, repos
from bzrlib.plugins.svn.client import Client
-from bzrlib.plugins.svn.ra import RemoteAccess, txdelta_send_stream
+from bzrlib.plugins.svn.ra import Auth, RemoteAccess, txdelta_send_stream
class TestCaseWithSubversionRepository(TestCaseInTempDir):
"""A test case that provides the ability to build Subversion
@@ -42,6 +42,11 @@
def setUp(self):
super(TestCaseWithSubversionRepository, self).setUp()
self.client_ctx = Client()
+ self.client_ctx.auth = Auth([ra.get_simple_provider(),
+ ra.get_username_provider(),
+ ra.get_ssl_client_cert_file_provider(),
+ ra.get_ssl_client_cert_pw_file_provider(),
+ ra.get_ssl_server_trust_file_provider()])
self.client_ctx.log_msg_func = self.log_message_func
def log_message_func(self, items, pool):
@@ -188,7 +193,7 @@
self.client_ctx.copy(oldpath, rev, newpath)
def client_update(self, path):
- self.client_ctx.update(path, "HEAD", True)
+ self.client_ctx.update([path], "HEAD", True)
def build_tree(self, files):
"""Create a directory tree.
=== modified file 'tree.py'
--- a/tree.py 2008-06-19 15:33:26 +0000
+++ b/tree.py 2008-06-21 21:47:34 +0000
@@ -22,14 +22,14 @@
from bzrlib.trace import mutter
from bzrlib.revisiontree import RevisionTree
-from bzrlib.plugins.svn.delta import apply_txdelta_handler
-
import os
import md5
from cStringIO import StringIO
import urllib
from bzrlib.plugins.svn import errors, properties, core, wc
+from bzrlib.plugins.svn.delta import apply_txdelta_handler
+
def parse_externals_description(base_url, val):
"""Parse an svn:externals property value.
=== modified file 'workingtree.py'
--- a/workingtree.py 2008-06-21 20:44:24 +0000
+++ b/workingtree.py 2008-06-21 21:47:34 +0000
@@ -53,6 +53,7 @@
import svn.core
+from bzrlib.plugins.svn.auth import create_auth_baton
from bzrlib.plugins.svn.client import Client
from bzrlib.plugins.svn.format import get_rich_root_format
@@ -80,7 +81,7 @@
self.bzrdir = bzrdir
self._branch = branch
self.base_revnum = 0
- self.client_ctx = Client(bzrdir.svn_url)
+ self.client_ctx = Client(auth=create_auth_baton(bzrdir.svn_url))
self._get_wc()
max_rev = revision_status(self.basedir, None, True)[1]
More information about the bazaar-commits
mailing list