Rev 1222: Provide equivalent of core module. in http://people.samba.org/bzr/jelmer/bzr-svn/0.4/

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


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

------------------------------------------------------------
revno: 1222
revision-id: jelmer at samba.org-20080615010806-ez5xru2zepz7rtv9
parent: jelmer at samba.org-20080615010127-lc6jgkyur0ya5vvu
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sun 2008-06-15 03:08:06 +0200
message:
  Provide equivalent of core module.
added:
  core.py                        core.py-20080615010310-67lnibnp889hlarb-1
modified:
  branch.py                      svnbranch.py-20051017135706-11c749eb0dab04a7
  commit.py                      commit.py-20060607190346-qvq128wgfubhhgm2-1
  logwalker.py                   logwalker.py-20060621215743-c13fhfnyzh1xzwh2-1
  remote.py                      format.py-20060406233823-b6fa009fe35dfde7
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
  tests/test_radir.py            test_radir.py-20061231173434-31utf9o4byu7wktm-1
  tree.py                        tree.py-20060624222557-dudlwqcmkf22lt2s-1
  workingtree.py                 workingtree.py-20060306120941-b083cb0fdd4a69de
=== modified file 'branch.py'
--- a/branch.py	2008-06-05 17:54:39 +0000
+++ b/branch.py	2008-06-15 01:08:06 +0000
@@ -27,6 +27,7 @@
 import svn.client, svn.core
 from svn.core import SubversionException
 
+from bzrlib.plugins.svn import core
 from bzrlib.plugins.svn.commit import push
 from bzrlib.plugins.svn.config import BranchConfig
 from bzrlib.plugins.svn.errors import NotSvnBranchPath, ERR_FS_NO_SUCH_REVISION
@@ -78,7 +79,7 @@
             if revnum is None:
                 raise NotBranchError(self.base)
             if self.repository.transport.check_path(branch_path.strip("/"), 
-                revnum) != svn.core.svn_node_dir:
+                revnum) != core.NODE_DIR:
                 raise NotBranchError(self.base)
         except SubversionException, (_, num):
             if num == ERR_FS_NO_SUCH_REVISION:

=== modified file 'commit.py'
--- a/commit.py	2008-06-06 17:19:53 +0000
+++ b/commit.py	2008-06-15 01:08:06 +0000
@@ -27,7 +27,7 @@
 from bzrlib.revision import NULL_REVISION
 from bzrlib.trace import mutter, warning
 
-from bzrlib.plugins.svn import properties
+from bzrlib.plugins.svn import core, properties
 
 from cStringIO import StringIO
 from bzrlib.plugins.svn.errors import ChangesRootLHSHistory, MissingPrefix, RevpropChangeFailed, ERR_FS_TXN_OUT_OF_DATE, ERR_REPOS_DISABLED_FEATURE
@@ -65,7 +65,7 @@
     for i in range(len(bp_parts), 0, -1):
         current = bp_parts[:i]
         path = "/".join(current).strip("/")
-        if transport.check_path(path, base_rev) == svn.core.svn_node_dir:
+        if transport.check_path(path, base_rev) == core.NODE_DIR:
             return current
     return []
 

=== added file 'core.py'
--- a/core.py	1970-01-01 00:00:00 +0000
+++ b/core.py	2008-06-15 01:08:06 +0000
@@ -0,0 +1,20 @@
+# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer at samba.org>
+ 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# 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

=== modified file 'logwalker.py'
--- a/logwalker.py	2008-06-06 17:19:53 +0000
+++ b/logwalker.py	2008-06-15 01:08:06 +0000
@@ -24,8 +24,8 @@
 from transport import SvnRaTransport
 import svn.core
 
+from bzrlib.plugins.svn import changes, core
 from bzrlib.plugins.svn.cache import CacheTable
-from bzrlib.plugins.svn import changes
 from bzrlib.plugins.svn.errors import ERR_FS_NO_SUCH_REVISION, ERR_FS_NOT_FOUND
 
 LOG_CHUNK_LIMIT = 0
@@ -397,9 +397,9 @@
         conn = self._transport.connections.get(self._transport.get_svn_repos_root())
         try:
             ft = conn.check_path(path, revnum)
-            if ft == svn.core.svn_node_file:
+            if ft == core.NODE_FILE:
                 return []
-            assert ft == svn.core.svn_node_dir
+            assert ft == core.NODE_DIR
         finally:
             self._transport.connections.add(conn)
 

=== modified file 'remote.py'
--- a/remote.py	2008-06-04 17:32:12 +0000
+++ b/remote.py	2008-06-15 01:08:06 +0000
@@ -25,6 +25,7 @@
 from svn.core import SubversionException
 import svn.core, svn.repos
 
+from bzrlib.plugins.svn import core
 from bzrlib.plugins.svn.errors import NoSvnRepositoryPresent
 from bzrlib.plugins.svn.format import get_rich_root_format, SvnRemoteFormat
 from bzrlib.plugins.svn.repository import SvnRepository
@@ -127,7 +128,7 @@
             full_branch_url = urlutils.join(repos.transport.base, 
                                             target_branch_path)
             if repos.transport.check_path(target_branch_path,
-                repos.get_latest_revnum()) != svn.core.svn_node_none:
+                repos.get_latest_revnum()) != core.NODE_NONE:
                 raise AlreadyBranchError(full_branch_url)
             push_new(repos, target_branch_path, source, stop_revision)
         finally:

=== modified file 'repository.py'
--- a/repository.py	2008-06-05 18:21:31 +0000
+++ b/repository.py	2008-06-15 01:08:06 +0000
@@ -34,9 +34,9 @@
 
 import os
 
+from bzrlib.plugins.svn import changes, core
 from bzrlib.plugins.svn.branchprops import PathPropertyProvider
 from bzrlib.plugins.svn.cache import create_cache_dir, sqlite3
-from bzrlib.plugins.svn import changes
 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
@@ -378,7 +378,7 @@
             return False
 
         try:
-            return (svn.core.svn_node_dir == self.transport.check_path(path, revnum))
+            return (core.NODE_DIR == self.transport.check_path(path, revnum))
         except SubversionException, (_, num):
             if num == errors.ERR_FS_NO_SUCH_REVISION:
                 return False

=== modified file 'tests/test_radir.py'
--- a/tests/test_radir.py	2008-06-05 03:39:17 +0000
+++ b/tests/test_radir.py	2008-06-15 01:08:06 +0000
@@ -24,6 +24,7 @@
 
 import svn
 
+from bzrlib.plugins.svn import core
 from bzrlib.plugins.svn.format import SvnRemoteFormat
 from bzrlib.plugins.svn.tests import TestCaseWithSubversionRepository
 from bzrlib.plugins.svn.transport import SvnRaTransport
@@ -75,7 +76,7 @@
         b = x.create_branch()
         self.assertEquals(repos_url+"/trunk", b.base)
         transport = SvnRaTransport(repos_url)
-        self.assertEquals(svn.core.svn_node_dir, 
+        self.assertEquals(core.NODE_DIR, 
                 transport.check_path("trunk", 1))
 
     def test_bad_dir(self):

=== modified file 'tree.py'
--- a/tree.py	2008-06-06 17:19:53 +0000
+++ b/tree.py	2008-06-15 01:08:06 +0000
@@ -31,7 +31,7 @@
 import svn.core, svn.wc, svn.delta
 from svn.core import Pool
 
-from bzrlib.plugins.svn import errors, properties
+from bzrlib.plugins.svn import errors, properties, core
 
 def parse_externals_description(base_url, val):
     """Parse an svn:externals property value.
@@ -330,7 +330,7 @@
 
                 assert entry
                 
-                if entry.kind == svn.core.svn_node_dir:
+                if entry.kind == core.NODE_DIR:
                     subwc = svn.wc.adm_open3(wc, 
                             self.workingtree.abspath(subrelpath), 
                                              False, 0, None)

=== modified file 'workingtree.py'
--- a/workingtree.py	2008-06-06 17:19:53 +0000
+++ b/workingtree.py	2008-06-15 01:08:06 +0000
@@ -32,7 +32,7 @@
 from bzrlib.transport.local import LocalTransport
 from bzrlib.workingtree import WorkingTree, WorkingTreeFormat
 
-from bzrlib.plugins.svn import properties
+from bzrlib.plugins.svn import core, properties
 from bzrlib.plugins.svn.branch import SvnBranch
 from bzrlib.plugins.svn.commit import _revision_id_to_svk_feature
 from bzrlib.plugins.svn.convert import SvnConverter
@@ -120,7 +120,7 @@
                     continue
 
                 # Ignore ignores on things that aren't directories
-                if entries[entry].kind != svn.core.svn_node_dir:
+                if entries[entry].kind != core.NODE_DIR:
                     continue
 
                 subprefix = os.path.join(prefix, entry)
@@ -332,7 +332,7 @@
                 entry = entries[name]
                 assert entry
                 
-                if entry.kind == svn.core.svn_node_dir:
+                if entry.kind == core.NODE_DIR:
                     subwc = svn.wc.adm_open3(wc, self.abspath(subrelpath), 
                                              False, 0, None)
                     try:




More information about the bazaar-commits mailing list