Rev 1227: Abstract away more of the standard python-svn bindings. in http://people.samba.org/bzr/jelmer/bzr-svn/0.4/

Jelmer Vernooij jelmer at samba.org
Sun Jun 15 02:46:29 BST 2008


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

------------------------------------------------------------
revno: 1227
revision-id: jelmer at samba.org-20080615014628-vr9qbhs2nmtfujff
parent: jelmer at samba.org-20080615014047-1bd142e7ht01x1bj
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sun 2008-06-15 03:46:28 +0200
message:
  Abstract away more of the standard python-svn bindings.
modified:
  auth.py                        auth.py-20071209174622-w8d42k6nm5yhxvi8-1
  commit.py                      commit.py-20060607190346-qvq128wgfubhhgm2-1
  core.py                        core.py-20080615010310-67lnibnp889hlarb-1
  ra.py                          ra.py-20080615005305-t5221niknu8rm6bt-1
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
=== modified file 'auth.py'
--- a/auth.py	2008-06-15 01:29:38 +0000
+++ b/auth.py	2008-06-15 01:46:28 +0000
@@ -200,8 +200,8 @@
     auth_baton = Auth(providers)
     if creds is not None:
         (user, password) = urllib.splitpasswd(creds)
-        if auth_baton.user is not None:
+        if user is not None:
             auth_baton.set_parameter(AUTH_PARAM_DEFAULT_USERNAME, user)
-        if auth_baton.password is not None:
+        if password is not None:
             auth_baton.set_parameter(AUTH_PARAM_DEFAULT_PASSWORD, password)
     return auth_baton.auth_baton

=== modified file 'commit.py'
--- a/commit.py	2008-06-15 01:08:06 +0000
+++ b/commit.py	2008-06-15 01:46:28 +0000
@@ -15,9 +15,6 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 """Committing and pushing to Subversion repositories."""
 
-import svn.delta
-from svn.core import Pool, SubversionException, svn_time_to_cstring
-
 from bzrlib import debug, osutils, urlutils
 from bzrlib.branch import Branch
 from bzrlib.errors import (BzrError, InvalidRevisionId, DivergedBranches, 
@@ -27,14 +24,18 @@
 from bzrlib.revision import NULL_REVISION
 from bzrlib.trace import mutter, warning
 
+from cStringIO import StringIO
+
+from svn.core import Pool
+
 from bzrlib.plugins.svn import core, properties
-
-from cStringIO import StringIO
+from bzrlib.plugins.svn.core import SubversionException, time_to_cstring
 from bzrlib.plugins.svn.errors import ChangesRootLHSHistory, MissingPrefix, RevpropChangeFailed, ERR_FS_TXN_OUT_OF_DATE, ERR_REPOS_DISABLED_FEATURE
 from bzrlib.plugins.svn.svk import (generate_svk_feature, serialize_svk_features, 
                  parse_svk_features, SVN_PROP_SVK_MERGE)
 from bzrlib.plugins.svn.logwalker import lazy_dict
 from bzrlib.plugins.svn.mapping import parse_revision_id
+from bzrlib.plugins.svn.ra import txdelta_send_stream
 from bzrlib.plugins.svn.repository import SvnRepositoryFormat, SvnRepository
 
 import urllib
@@ -196,7 +197,7 @@
         """
         assert baton is not None
         (txdelta, txbaton) = self.editor.apply_textdelta(baton, None, self.pool)
-        digest = svn.delta.svn_txdelta_send_stream(StringIO(contents), txdelta, txbaton, self.pool)
+        digest = txdelta_send_stream(StringIO(contents), txdelta, txbaton, self.pool)
         if 'validate' in debug.debug_flags:
             from fetch import md5_strings
             assert digest == md5_strings(contents)

=== modified file 'core.py'
--- a/core.py	2008-06-15 01:08:06 +0000
+++ b/core.py	2008-06-15 01:46:28 +0000
@@ -13,8 +13,12 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-
-NODE_NONE = 0
-NODE_FILE = 1
-NODE_DIR = 2
-NODE_UNKNOWN = 3
+import svn.core
+
+NODE_NONE = svn.core.svn_node_none
+NODE_FILE = svn.core.svn_node_file
+NODE_DIR = svn.core.svn_node_dir
+NODE_UNKNOWN = svn.core.svn_node_unknown
+
+SubversionException = svn.core.SubversionException
+time_to_cstring = svn.core.svn_time_to_cstring

=== modified file 'ra.py'
--- a/ra.py	2008-06-15 01:29:38 +0000
+++ b/ra.py	2008-06-15 01:46:28 +0000
@@ -13,13 +13,15 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-import svn.core
+import svn.core, svn.delta
 
 get_username_prompt_provider = svn.core.svn_auth_get_username_prompt_provider
 get_simple_prompt_provider = svn.core.svn_auth_get_simple_prompt_provider
 get_ssl_client_cert_pw_prompt_provider = svn.core.svn_auth_get_ssl_client_cert_pw_prompt_provider
 get_ssl_server_trust_prompt_provider = svn.core.svn_auth_get_ssl_server_trust_prompt_provider
 
+txdelta_send_stream = svn.delta.svn_txdelta_send_stream
+
 DIRENT_KIND = 0x0001
 
 class Auth:

=== modified file 'repository.py'
--- a/repository.py	2008-06-15 01:08:06 +0000
+++ b/repository.py	2008-06-15 01:46:28 +0000
@@ -29,24 +29,20 @@
 from bzrlib.transport import Transport, get_transport
 from bzrlib.trace import info, mutter
 
-from svn.core import SubversionException
-import svn.core
-
 import os
 
-from bzrlib.plugins.svn import changes, core
+from bzrlib.plugins.svn import changes, core, errors, logwalker
 from bzrlib.plugins.svn.branchprops import PathPropertyProvider
 from bzrlib.plugins.svn.cache import create_cache_dir, sqlite3
 from bzrlib.plugins.svn.changes import changes_path, find_prev_location
 from bzrlib.plugins.svn.config import SvnRepositoryConfig
-from bzrlib.plugins.svn.parents import SqliteCachingParentsProvider
-from bzrlib.plugins.svn import errors
-from bzrlib.plugins.svn import logwalker
+from bzrlib.plugins.svn.core import SubversionException
 from bzrlib.plugins.svn.mapping import (SVN_PROP_BZR_REVISION_ID, SVN_REVPROP_BZR_SIGNATURE,
                      parse_revision_metadata, parse_revid_property, 
                      parse_merge_property, BzrSvnMapping,
                      get_default_mapping, parse_revision_id)
 from bzrlib.plugins.svn.mapping3 import BzrSvnMappingv3FileProps
+from bzrlib.plugins.svn.parents import SqliteCachingParentsProvider
 from bzrlib.plugins.svn.revids import CachingRevidMap, RevidMap
 from bzrlib.plugins.svn.svk import (SVN_PROP_SVK_MERGE, svk_features_merged_since, 
                  parse_svk_feature)




More information about the bazaar-commits mailing list