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
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:
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
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 []
--- /dev/null
+# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer@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
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
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)
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
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:
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
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
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
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):
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.
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)
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
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)
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: