Rev 1239: Cherrypick some changes from the cext branch. in http://people.samba.org/bzr/jelmer/bzr-svn/0.4/

Jelmer Vernooij jelmer at samba.org
Tue Jun 17 23:31:21 BST 2008


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

------------------------------------------------------------
revno: 1239
revision-id: jelmer at samba.org-20080617223119-ub4cxwjhnya05p5n
parent: jelmer at samba.org-20080617222600-mwb5selnhivyzmtu
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Wed 2008-06-18 00:31:19 +0200
message:
  Cherrypick some changes from the cext branch.
modified:
  format.py                      format.py-20070917005147-94kb7zysotf82kqw-1
  tests/test_workingtree.py      test_workingtree.py-20060622191524-0di7bc3q1ckdbybb-1
  tree.py                        tree.py-20060624222557-dudlwqcmkf22lt2s-1
  workingtree.py                 workingtree.py-20060306120941-b083cb0fdd4a69de
=== modified file 'format.py'
--- a/format.py	2008-06-15 02:11:24 +0000
+++ b/format.py	2008-06-17 22:31:19 +0000
@@ -23,8 +23,7 @@
 import os
 
 lazy_import(globals(), """
-from bzrlib.plugins.svn import errors
-from bzrlib.plugins.svn import remote
+from bzrlib.plugins.svn import errors, remote
 
 from bzrlib import errors as bzr_errors
 """)
@@ -84,7 +83,7 @@
         """See BzrDir.initialize_on_transport()."""
         from transport import get_svn_ra_transport
         from bzrlib.transport.local import LocalTransport
-        import svn.repos
+        from svn import repos
 
         if not isinstance(transport, LocalTransport):
             raise NotImplementedError(self.initialize, 
@@ -92,7 +91,7 @@
                 "non-local transports")
 
         local_path = transport._local_base.rstrip("/")
-        svn.repos.create(local_path, '', '', None, None)
+        repos.create(local_path, '', '', None, None)
         # All revision property changes
         revprop_hook = os.path.join(local_path, "hooks", "pre-revprop-change")
         open(revprop_hook, 'w').write("#!/bin/sh")

=== modified file 'tests/test_workingtree.py'
--- a/tests/test_workingtree.py	2008-06-17 19:53:50 +0000
+++ b/tests/test_workingtree.py	2008-06-17 22:31:19 +0000
@@ -26,7 +26,7 @@
 from bzrlib.trace import mutter
 from bzrlib.workingtree import WorkingTree
 
-import svn.wc
+from svn import wc
 
 from bzrlib.plugins.svn.transport import svn_config
 from bzrlib.plugins.svn.tests import TestCaseWithSubversionRepository
@@ -208,13 +208,13 @@
     def test_get_ignore_list_empty(self):
         self.make_client('a', 'dc')
         tree = self.open_checkout("dc")
-        self.assertEqual(set([".svn"] + svn.wc.get_default_ignores(svn_config)), tree.get_ignore_list())
+        self.assertEqual(set([".svn"] + wc.get_default_ignores(svn_config)), tree.get_ignore_list())
 
     def test_get_ignore_list_onelevel(self):
         self.make_client('a', 'dc')
         self.client_set_prop("dc", "svn:ignore", "*.d\n*.c\n")
         tree = self.open_checkout("dc")
-        self.assertEqual(set([".svn"] + svn.wc.get_default_ignores(svn_config) + ["./*.d", "./*.c"]), tree.get_ignore_list())
+        self.assertEqual(set([".svn"] + wc.get_default_ignores(svn_config) + ["./*.d", "./*.c"]), tree.get_ignore_list())
 
     def test_get_ignore_list_morelevel(self):
         self.make_client('a', 'dc')
@@ -223,7 +223,7 @@
         self.client_add("dc/x")
         self.client_set_prop("dc/x", "svn:ignore", "*.e\n")
         tree = self.open_checkout("dc")
-        self.assertEqual(set([".svn"] + svn.wc.get_default_ignores(svn_config) + ["./*.d", "./*.c", "./x/*.e"]), tree.get_ignore_list())
+        self.assertEqual(set([".svn"] + wc.get_default_ignores(svn_config) + ["./*.d", "./*.c", "./x/*.e"]), tree.get_ignore_list())
 
     def test_add_reopen(self):
         self.make_client('a', 'dc')

=== modified file 'tree.py'
--- a/tree.py	2008-06-17 21:03:10 +0000
+++ b/tree.py	2008-06-17 22:31:19 +0000
@@ -135,7 +135,8 @@
         editor = TreeBuildEditor(self)
         self.file_data = {}
         root_repos = repository.transport.get_svn_repos_root()
-        reporter = repository.transport.do_switch(
+        conn = repository.transport.get_connection()
+        reporter = conn.do_switch(
                 self.revnum, "", True, 
                 urlutils.join(root_repos, self.branch_path), editor)
         reporter.set_path("", 0, True, None)

=== modified file 'workingtree.py'
--- a/workingtree.py	2008-06-17 20:55:23 +0000
+++ b/workingtree.py	2008-06-17 22:31:19 +0000
@@ -16,7 +16,7 @@
 """Checkouts and working trees (working copies)."""
 
 import bzrlib, bzrlib.add
-from bzrlib import urlutils
+from bzrlib import osutils, urlutils
 from bzrlib.branch import PullResult
 from bzrlib.bzrdir import BzrDirFormat, BzrDir
 from bzrlib.errors import (InvalidRevisionId, NotBranchError, NoSuchFile,
@@ -25,7 +25,6 @@
 from bzrlib.inventory import Inventory, InventoryFile, InventoryLink
 from bzrlib.lockable_files import TransportLock, LockableFiles
 from bzrlib.lockdir import LockDir
-from bzrlib.osutils import file_kind, fingerprint_file, supports_executable
 from bzrlib.revision import NULL_REVISION
 from bzrlib.trace import mutter
 from bzrlib.revisiontree import RevisionTree
@@ -252,7 +251,7 @@
                 file = InventoryFile(id, os.path.basename(relpath), parent_id)
                 file.revision = revid
                 try:
-                    data = fingerprint_file(open(self.abspath(relpath)))
+                    data = osutils.fingerprint_file(open(self.abspath(relpath)))
                     file.text_sha1 = data['sha1']
                     file.text_size = data['size']
                     file.executable = self.is_executable(id, relpath)
@@ -504,7 +503,7 @@
                         mutter('adding %r', file_path)
                         svn.wc.add2(file_path, wc, None, 0, None, None, None)
                     added.append(file_path)
-                if recurse and file_kind(file_path) == 'directory':
+                if recurse and osutils.file_kind(file_path) == 'directory':
                     # Filter out ignored files and update ignored
                     for c in os.listdir(file_path):
                         if self.is_control_filename(c):
@@ -578,7 +577,7 @@
     def get_file_sha1(self, file_id, path=None, stat_value=None):
         if not path:
             path = self._inventory.id2path(file_id)
-        return fingerprint_file(open(self.abspath(path)))['sha1']
+        return osutils.fingerprint_file(open(self.abspath(path)))['sha1']
 
     def _change_fileid_mapping(self, id, path, wc=None):
         if wc is None:
@@ -690,7 +689,7 @@
         finally:
             self.branch.unlock()
 
-    if not supports_executable():
+    if not osutils.supports_executable():
         def is_executable(self, file_id, path=None):
             inv = self.basis_tree()._inventory
             if file_id in inv:




More information about the bazaar-commits mailing list