-# Copyright (C) 2007 Jelmer Vernooij <jelmer@samba.org>
+# Copyright (C) 2007-2008 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
from bzrlib import osutils, urlutils, trace
from bzrlib.config import IniBasedConfig, config_dir, ensure_config_dir_exists, GlobalConfig, LocationConfig, Config, STORE_BRANCH, STORE_GLOBAL, STORE_LOCATION
+from bzrlib.plugins.svn.core import SubversionException
+
import os
-from mapping3.scheme import BranchingScheme
-import svn.core
+from bzrlib.plugins.svn import properties
# Settings are stored by UUID.
# Data stored includes default branching scheme and locations the repository
return None
return GlobalConfig()._get_user_option(name)
+ def get_reuse_revisions(self):
+ ret = self._get_user_option("reuse-revisions")
+ if ret is None:
+ return "other-branches"
+ assert ret in ("none", "other-branches", "removed-branches")
+ return ret
+
def get_branching_scheme(self):
"""Get the branching scheme.
:return: BranchingScheme instance.
"""
+ from mapping3.scheme import BranchingScheme
schemename = self._get_user_option("branching-scheme", use_global=False)
if schemename is not None:
return BranchingScheme.find_scheme(schemename.encode('ascii'))
def get_list(parser, section):
try:
if parser.get_bool(section, "override-svn-revprops"):
- return [svn.core.SVN_PROP_REVISION_DATE, svn.core.SVN_PROP_REVISION_AUTHOR]
+ return [properties.PROP_REVISION_DATE, properties.PROP_REVISION_AUTHOR]
return []
except ValueError:
- return parser.get_value(section, "override-svn-revprops").split(",")
+ val = parser.get_value(section, "override-svn-revprops")
+ if not isinstance(val, list):
+ return [val]
+ return val
except KeyError:
return None
ret = get_list(self._get_parser(), self.uuid)
self._repository_config = SvnRepositoryConfig(self.branch.repository.uuid)
return self._repository_config
+ def get_set_revprops(self):
+ return self._get_repository_config().get_set_revprops()
+
+ def get_log_strip_trailing_newline(self):
+ return self._get_repository_config().get_log_strip_trailing_newline()
+
+ def get_override_svn_revprops(self):
+ return self._get_repository_config().get_override_svn_revprops()
+
def _get_user_option(self, option_name):
"""See Config._get_user_option."""
for source in self.option_sources:
return "True"
else:
return "False"
- except svn.core.SubversionException:
+ except SubversionException:
return None
return None