summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2014-01-01 17:24:14 +0000
committerLars Wirzenius <liw@liw.fi>2014-01-01 17:24:14 +0000
commit4b354d08a562fd55617c78c2329a0a0934e5437b (patch)
tree8363dfcfd8b34c4ad5a70c003cfbf92b1f4ef5ff
parent601a4bd08d4f1ea24d5f34032370b0aaaa300bbb (diff)
downloadobnam-4b354d08a562fd55617c78c2329a0a0934e5437b.tar.gz
Move all repo format 6 code into its own module
This will make it clearer what code is relevant to format 6 only.
-rw-r--r--obnamlib/__init__.py41
-rw-r--r--obnamlib/fmt_6/__init__.py0
-rw-r--r--obnamlib/fmt_6/checksumtree.py (renamed from obnamlib/checksumtree.py)0
-rw-r--r--obnamlib/fmt_6/checksumtree_tests.py (renamed from obnamlib/checksumtree_tests.py)0
-rw-r--r--obnamlib/fmt_6/chunklist.py (renamed from obnamlib/chunklist.py)0
-rw-r--r--obnamlib/fmt_6/chunklist_tests.py (renamed from obnamlib/chunklist_tests.py)0
-rw-r--r--obnamlib/fmt_6/clientlist.py (renamed from obnamlib/clientlist.py)0
-rw-r--r--obnamlib/fmt_6/clientlist_tests.py (renamed from obnamlib/clientlist_tests.py)0
-rw-r--r--obnamlib/fmt_6/clientmetadatatree.py (renamed from obnamlib/clientmetadatatree.py)0
-rw-r--r--obnamlib/fmt_6/clientmetadatatree_tests.py (renamed from obnamlib/clientmetadatatree_tests.py)0
-rw-r--r--obnamlib/fmt_6/metadata.py (renamed from obnamlib/metadata.py)0
-rw-r--r--obnamlib/fmt_6/metadata_tests.py (renamed from obnamlib/metadata_tests.py)41
-rw-r--r--obnamlib/fmt_6/repo_fmt_6.py (renamed from obnamlib/repo_fmt_6.py)0
-rw-r--r--obnamlib/fmt_6/repo_fmt_6_tests.py (renamed from obnamlib/repo_fmt_6_tests.py)0
-rw-r--r--obnamlib/fmt_6/repo_tree.py (renamed from obnamlib/repo_tree.py)0
-rw-r--r--without-tests61
16 files changed, 82 insertions, 61 deletions
diff --git a/obnamlib/__init__.py b/obnamlib/__init__.py
index 0c62b3cf..70c3ee57 100644
--- a/obnamlib/__init__.py
+++ b/obnamlib/__init__.py
@@ -88,9 +88,11 @@ from hooks import Hook, MissingFilterError, FilterHook, HookManager
from pluginbase import ObnamPlugin
from vfs import VirtualFileSystem, VfsFactory, VfsTests
from vfs_local import LocalFS
-from metadata import (read_metadata, set_metadata, Metadata, metadata_fields,
- metadata_verify_fields, encode_metadata, decode_metadata)
from fsck_work_item import WorkItem
+from lockmgr import LockManager
+from forget_policy import ForgetPolicy
+from app import App
+
from repo_factory import (
RepositoryFactory,
UnknownRepositoryFormat,
@@ -141,16 +143,33 @@ from repo_interface import (
REPO_FILE_INO,
REPO_FILE_MD5,
REPO_FILE_INTEGER_KEYS)
+
+#
+# Repository format dummy specific modules.
+#
+
from repo_dummy import RepositoryFormatDummy
-from repo_fmt_6 import RepositoryFormat6
-from repo_tree import RepositoryTree
-from chunklist import ChunkList
-from clientlist import ClientList
-from checksumtree import ChecksumTree
-from clientmetadatatree import ClientMetadataTree
-from lockmgr import LockManager
+
+#
+# Repository format 6 specific modules.
+#
+
+from fmt_6.metadata import (
+ Metadata,
+ read_metadata,
+ set_metadata,
+ metadata_fields,
+ metadata_verify_fields,
+ encode_metadata,
+ decode_metadata)
+from fmt_6.repo_fmt_6 import RepositoryFormat6
+from fmt_6.repo_tree import RepositoryTree
+from fmt_6.chunklist import ChunkList
+from fmt_6.clientlist import ClientList
+from fmt_6.checksumtree import ChecksumTree
+from fmt_6.clientmetadatatree import ClientMetadataTree
+
+# This is the OLD and DEPRECATED format 6 implementation.
from repo import Repository, LockFail, BadFormat
-from forget_policy import ForgetPolicy
-from app import App
__all__ = locals()
diff --git a/obnamlib/fmt_6/__init__.py b/obnamlib/fmt_6/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/obnamlib/fmt_6/__init__.py
diff --git a/obnamlib/checksumtree.py b/obnamlib/fmt_6/checksumtree.py
index 3fdc0ac5..3fdc0ac5 100644
--- a/obnamlib/checksumtree.py
+++ b/obnamlib/fmt_6/checksumtree.py
diff --git a/obnamlib/checksumtree_tests.py b/obnamlib/fmt_6/checksumtree_tests.py
index 01736ea7..01736ea7 100644
--- a/obnamlib/checksumtree_tests.py
+++ b/obnamlib/fmt_6/checksumtree_tests.py
diff --git a/obnamlib/chunklist.py b/obnamlib/fmt_6/chunklist.py
index 5e1daf77..5e1daf77 100644
--- a/obnamlib/chunklist.py
+++ b/obnamlib/fmt_6/chunklist.py
diff --git a/obnamlib/chunklist_tests.py b/obnamlib/fmt_6/chunklist_tests.py
index 99cb72e7..99cb72e7 100644
--- a/obnamlib/chunklist_tests.py
+++ b/obnamlib/fmt_6/chunklist_tests.py
diff --git a/obnamlib/clientlist.py b/obnamlib/fmt_6/clientlist.py
index 69ff1708..69ff1708 100644
--- a/obnamlib/clientlist.py
+++ b/obnamlib/fmt_6/clientlist.py
diff --git a/obnamlib/clientlist_tests.py b/obnamlib/fmt_6/clientlist_tests.py
index ff1d1e04..ff1d1e04 100644
--- a/obnamlib/clientlist_tests.py
+++ b/obnamlib/fmt_6/clientlist_tests.py
diff --git a/obnamlib/clientmetadatatree.py b/obnamlib/fmt_6/clientmetadatatree.py
index 1019f71b..1019f71b 100644
--- a/obnamlib/clientmetadatatree.py
+++ b/obnamlib/fmt_6/clientmetadatatree.py
diff --git a/obnamlib/clientmetadatatree_tests.py b/obnamlib/fmt_6/clientmetadatatree_tests.py
index 07bf92ae..07bf92ae 100644
--- a/obnamlib/clientmetadatatree_tests.py
+++ b/obnamlib/fmt_6/clientmetadatatree_tests.py
diff --git a/obnamlib/metadata.py b/obnamlib/fmt_6/metadata.py
index 146c0ce3..146c0ce3 100644
--- a/obnamlib/metadata.py
+++ b/obnamlib/fmt_6/metadata.py
diff --git a/obnamlib/metadata_tests.py b/obnamlib/fmt_6/metadata_tests.py
index 557f2c97..ad2755b7 100644
--- a/obnamlib/metadata_tests.py
+++ b/obnamlib/fmt_6/metadata_tests.py
@@ -245,7 +245,7 @@ class MetadataCodingTests(unittest.TestCase):
def equal(self, meta1, meta2):
for name in dir(meta1):
- if name in obnamlib.metadata.metadata_fields:
+ if name in obnamlib.metadata_fields:
value1 = getattr(meta1, name)
value2 = getattr(meta2, name)
self.assertEqual(
@@ -255,39 +255,40 @@ class MetadataCodingTests(unittest.TestCase):
(name, value1, value2))
def test_round_trip(self):
- metadata = obnamlib.metadata.Metadata(st_mode=1,
- st_mtime_sec=2,
- st_mtime_nsec=12756,
- st_nlink=3,
- st_size=4,
- st_uid=5,
- st_blocks=6,
- st_dev=7,
- st_gid=8,
- st_ino=9,
- st_atime_sec=10,
- st_atime_nsec=123,
- groupname='group',
- username='user',
- target='target',
- md5='checksum')
+ metadata = obnamlib.Metadata(
+ st_mode=1,
+ st_mtime_sec=2,
+ st_mtime_nsec=12756,
+ st_nlink=3,
+ st_size=4,
+ st_uid=5,
+ st_blocks=6,
+ st_dev=7,
+ st_gid=8,
+ st_ino=9,
+ st_atime_sec=10,
+ st_atime_nsec=123,
+ groupname='group',
+ username='user',
+ target='target',
+ md5='checksum')
encoded = obnamlib.encode_metadata(metadata)
decoded = obnamlib.decode_metadata(encoded)
self.equal(metadata, decoded)
def test_round_trip_for_None_values(self):
- metadata = obnamlib.metadata.Metadata()
+ metadata = obnamlib.Metadata()
encoded = obnamlib.encode_metadata(metadata)
decoded = obnamlib.decode_metadata(encoded)
for name in dir(metadata):
- if name in obnamlib.metadata.metadata_fields:
+ if name in obnamlib.metadata_fields:
self.assertEqual(getattr(decoded, name), None,
'attribute %s must be None' % name)
def test_round_trip_for_maximum_values(self):
unsigned_max = 2**64 - 1
signed_max = 2**63 - 1
- metadata = obnamlib.metadata.Metadata(
+ metadata = obnamlib.Metadata(
st_mode=unsigned_max,
st_mtime_sec=signed_max,
st_mtime_nsec=unsigned_max,
diff --git a/obnamlib/repo_fmt_6.py b/obnamlib/fmt_6/repo_fmt_6.py
index 487db598..487db598 100644
--- a/obnamlib/repo_fmt_6.py
+++ b/obnamlib/fmt_6/repo_fmt_6.py
diff --git a/obnamlib/repo_fmt_6_tests.py b/obnamlib/fmt_6/repo_fmt_6_tests.py
index ad231e0e..ad231e0e 100644
--- a/obnamlib/repo_fmt_6_tests.py
+++ b/obnamlib/fmt_6/repo_fmt_6_tests.py
diff --git a/obnamlib/repo_tree.py b/obnamlib/fmt_6/repo_tree.py
index a538ee7b..a538ee7b 100644
--- a/obnamlib/repo_tree.py
+++ b/obnamlib/fmt_6/repo_tree.py
diff --git a/without-tests b/without-tests
index 8902448c..1e212d35 100644
--- a/without-tests
+++ b/without-tests
@@ -1,32 +1,33 @@
-./setup.py
-./obnamlib/__init__.py
-./obnamlib/app.py
-./obnamlib/vfs.py
-./obnamlib/fsck_work_item.py
-./obnamlib/plugins/backup_plugin.py
-./obnamlib/plugins/restore_plugin.py
-./obnamlib/plugins/show_plugin.py
-./obnamlib/plugins/verify_plugin.py
-./test-plugins/hello_plugin.py
-./test-plugins/oldhello_plugin.py
-./test-plugins/aaa_hello_plugin.py
-./test-plugins/wrongversion_plugin.py
-./obnamlib/plugins/forget_plugin.py
-./obnamlib/plugins/fsck_plugin.py
-./obnamlib/plugins/vfs_local_plugin.py
-./obnamlib/plugins/sftp_plugin.py
-./obnamlib/plugins/force_lock_plugin.py
-
-./obnamlib/plugins/__init__.py
-./obnamlib/repo_tree.py
-./obnamlib/plugins/encryption_plugin.py
-./obnamlib/plugins/compression_plugin.py
-
-./.pc/debian-changes-0.22-2/obnamlib/app.py
-./.pc/debian-changes-0.22-2/obnamlib/plugins/forget_plugin.py
-./.pc/debian-changes-0.22-2/obnamlib/plugins/verify_plugin.py
-./.pc/debian-changes-0.22-2/obnamlib/plugins/backup_plugin.py
-./.pc/debian-changes-0.22-2/obnamlib/plugins/fsck_plugin.py
-./.pc/debian-changes-0.22-2/obnamlib/plugins/restore_plugin.py
+setup.py
+obnamlib/__init__.py
+obnamlib/app.py
+obnamlib/fsck_work_item.py
obnamlib/repo_interface.py
+obnamlib/vfs.py
+obnamlib/fmt_6/__init__.py
+obnamlib/fmt_6/repo_tree.py
+obnamlib/plugins/__init__.py
+obnamlib/plugins/backup_plugin.py
+obnamlib/plugins/compression_plugin.py
+obnamlib/plugins/encryption_plugin.py
+obnamlib/plugins/force_lock_plugin.py
+obnamlib/plugins/forget_plugin.py
+obnamlib/plugins/fsck_plugin.py
obnamlib/plugins/fuse_plugin.py
+obnamlib/plugins/restore_plugin.py
+obnamlib/plugins/sftp_plugin.py
+obnamlib/plugins/show_plugin.py
+obnamlib/plugins/verify_plugin.py
+obnamlib/plugins/vfs_local_plugin.py
+
+test-plugins/hello_plugin.py
+test-plugins/oldhello_plugin.py
+test-plugins/aaa_hello_plugin.py
+test-plugins/wrongversion_plugin.py
+
+.pc/debian-changes-0.22-2/obnamlib/app.py
+.pc/debian-changes-0.22-2/obnamlib/plugins/forget_plugin.py
+.pc/debian-changes-0.22-2/obnamlib/plugins/verify_plugin.py
+.pc/debian-changes-0.22-2/obnamlib/plugins/backup_plugin.py
+.pc/debian-changes-0.22-2/obnamlib/plugins/fsck_plugin.py
+.pc/debian-changes-0.22-2/obnamlib/plugins/restore_plugin.py