Rev 493: Remember locations and branching scheme. in file:///data/jelmer/bzr-svn/0.4/

Jelmer Vernooij jelmer at samba.org
Thu Jul 12 09:28:25 BST 2007


At file:///data/jelmer/bzr-svn/0.4/

------------------------------------------------------------
revno: 493
revision-id: jelmer at samba.org-20070624201354-uiz245ufev3v94ee
parent: jelmer at samba.org-20070624193508-2f21180q93i5v5bx
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Sun 2007-06-24 22:13:54 +0200
message:
  Remember locations and branching scheme.
modified:
  config.py                      config.py-20070624185721-0j8f1ly75uo4s1lk-1
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
  tests/test_config.py           test_config.py-20070624193244-itvnst60evjidr4z-1
=== modified file 'config.py'
--- a/config.py	2007-06-24 19:35:08 +0000
+++ b/config.py	2007-06-24 20:13:54 +0000
@@ -16,7 +16,9 @@
 """Stores per-repository settings."""
 
 from bzrlib import osutils, urlutils
-from bzrlib.config import IniBasedConfig, config_dir
+from bzrlib.config import IniBasedConfig, config_dir, ensure_config_dir_exists
+
+import os
 
 # Settings are stored by UUID. 
 # Data stored includes default branching scheme and locations the repository 
@@ -57,6 +59,8 @@
         self.set_user_option('locations', ";".join(list(locations)))
 
     def set_user_option(self, name, value):
+        conf_dir = os.path.dirname(self._get_filename())
+        ensure_config_dir_exists(conf_dir)
         self._get_parser()[self.uuid][name] = value
         f = open(self._get_filename(), 'wb')
         self._get_parser().write(f)

=== modified file 'repository.py'
--- a/repository.py	2007-06-24 17:52:51 +0000
+++ b/repository.py	2007-06-24 20:13:54 +0000
@@ -36,6 +36,7 @@
 
 from branchprops import BranchPropertyList
 from cache import create_cache_dir, sqlite3
+from config import SvnRepositoryConfig
 import errors
 import logwalker
 from revids import (generate_svn_revision_id, parse_svn_revision_id, 
@@ -181,6 +182,8 @@
         self.dir_cache = {}
         self.scheme = bzrdir.scheme
         self.pool = Pool()
+        self.config = SvnRepositoryConfig(self.uuid)
+        self.config.add_location(self.base)
 
         assert self.base
         assert self.uuid
@@ -202,6 +205,7 @@
 
     def set_branching_scheme(self, scheme):
         self.scheme = scheme
+        self.config.set_branching_scheme(str(scheme))
 
     def _warn_if_deprecated(self):
         # This class isn't deprecated

=== modified file 'tests/test_config.py'
--- a/tests/test_config.py	2007-06-24 19:35:08 +0000
+++ b/tests/test_config.py	2007-06-24 20:13:54 +0000
@@ -18,7 +18,7 @@
 
 from config import SvnRepositoryConfig
 
-from unittest import TestCase
+from bzrlib.tests import TestCase
 
 class ReposConfigTests(TestCase):
     def test_create(self):




More information about the bazaar-commits mailing list