Rev 5608: (jelmer) Avoid hardcoded list of repository formats that do not support in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Jan 13 02:43:22 UTC 2011


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5608 [merge]
revision-id: pqm at pqm.ubuntu.com-20110113024321-d1ssmy4knbv806zp
parent: pqm at pqm.ubuntu.com-20110113020950-fj3kzj8wviwrkcrn
parent: jelmer at samba.org-20110113004119-u20w9f5vn82oxz26
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2011-01-13 02:43:21 +0000
message:
  (jelmer) Avoid hardcoded list of repository formats that do not support
   funky characters in filenames. (Jelmer Vernooij)
modified:
  bzrlib/repofmt/weaverepo.py    presplitout.py-20070125045333-wfav3tsh73oxu3zk-1
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/tests/per_interrepository/test_interrepository.py test_interrepository.py-20060220061411-1ec13fa99e5e3eee
  bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
=== modified file 'bzrlib/repofmt/weaverepo.py'
--- a/bzrlib/repofmt/weaverepo.py	2011-01-12 00:43:17 +0000
+++ b/bzrlib/repofmt/weaverepo.py	2011-01-13 00:41:19 +0000
@@ -340,6 +340,8 @@
     has been removed.
     """
 
+    supports_funky_characters = False
+
     _matchingbzrdir = bzrdir.BzrDirFormat4()
 
     def get_format_description(self):
@@ -389,6 +391,8 @@
 
     _versionedfile_class = weave.WeaveFile
     _matchingbzrdir = bzrdir.BzrDirFormat5()
+    supports_funky_characters = False
+
     @property
     def _serializer(self):
         return xml5.serializer_v5
@@ -434,6 +438,7 @@
 
     _versionedfile_class = weave.WeaveFile
     _matchingbzrdir = bzrdir.BzrDirFormat6()
+    supports_funky_characters = False
     @property
     def _serializer(self):
         return xml5.serializer_v5

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2011-01-12 16:41:08 +0000
+++ b/bzrlib/repository.py	2011-01-13 00:41:19 +0000
@@ -3082,6 +3082,9 @@
     supports_tree_reference = None
     # Is the format experimental ?
     experimental = False
+    # Does this repository format escape funky characters, or does it create files with
+    # similar names as the versioned files in its contents on disk ?
+    supports_funky_characters = True
 
     def __repr__(self):
         return "%s()" % self.__class__.__name__

=== modified file 'bzrlib/tests/per_interrepository/test_interrepository.py'
--- a/bzrlib/tests/per_interrepository/test_interrepository.py	2011-01-12 01:01:53 +0000
+++ b/bzrlib/tests/per_interrepository/test_interrepository.py	2011-01-13 00:41:19 +0000
@@ -22,7 +22,6 @@
 import bzrlib.errors as errors
 import bzrlib.gpg
 from bzrlib.inventory import Inventory
-import bzrlib.repofmt.weaverepo as weaverepo
 from bzrlib.revision import NULL_REVISION
 from bzrlib.tests import (
     TestNotApplicable,
@@ -59,12 +58,9 @@
 
 
 def check_repo_format_for_funky_id_on_win32(repo):
-    if (isinstance(repo, (weaverepo.AllInOneRepository,
-                          weaverepo.WeaveMetaDirRepository))
-        and sys.platform == 'win32'):
-            raise TestSkipped("funky chars not allowed"
-                              " on this platform in repository"
-                              " %s" % repo.__class__.__name__)
+    if not repo._format.supports_funky_characters and sys.platform == 'win32':
+        raise TestSkipped("funky chars not allowed on this platform in repository"
+                          " %s" % repo.__class__.__name__)
 
 
 class TestInterRepository(TestCaseWithInterRepository):
@@ -105,7 +101,8 @@
         # and sign 'rev2'
         tree_a.branch.repository.lock_write()
         tree_a.branch.repository.start_write_group()
-        tree_a.branch.repository.sign_revision('rev2', bzrlib.gpg.LoopbackGPGStrategy(None))
+        tree_a.branch.repository.sign_revision('rev2',
+            bzrlib.gpg.LoopbackGPGStrategy(None))
         tree_a.branch.repository.commit_write_group()
         tree_a.branch.repository.unlock()
 

=== modified file 'bzrlib/transform.py'
--- a/bzrlib/transform.py	2011-01-13 01:32:26 +0000
+++ b/bzrlib/transform.py	2011-01-13 02:43:21 +0000
@@ -19,6 +19,7 @@
 from stat import S_ISREG, S_IEXEC
 import time
 
+import bzrlib
 from bzrlib import (
     errors,
     lazy_import,




More information about the bazaar-commits mailing list