aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/storage/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'libbe/storage/__init__.py')
-rw-r--r--libbe/storage/__init__.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/libbe/storage/__init__.py b/libbe/storage/__init__.py
new file mode 100644
index 0000000..e99f799
--- /dev/null
+++ b/libbe/storage/__init__.py
@@ -0,0 +1,37 @@
+# Copyright
+
+import base
+
+ConnectionError = base.ConnectionError
+InvalidStorageVersion = base.InvalidStorageVersion
+InvalidID = base.InvalidID
+InvalidRevision = base.InvalidRevision
+InvalidDirectory = base.InvalidDirectory
+NotWriteable = base.NotWriteable
+NotReadable = base.NotReadable
+EmptyCommit = base.EmptyCommit
+
+# a list of all past versions
+STORAGE_VERSIONS = ['Bugs Everywhere Tree 1 0',
+ 'Bugs Everywhere Directory v1.1',
+ 'Bugs Everywhere Directory v1.2',
+ 'Bugs Everywhere Directory v1.3',
+ 'Bugs Everywhere Directory v1.4',
+ ]
+
+# the current version
+STORAGE_VERSION = STORAGE_VERSIONS[-1]
+
+def get_storage(location):
+ """
+ Return a Storage instance from a repo location string.
+ """
+ import vcs
+ s = vcs.detect_vcs(location)
+ s.repo = location
+ return s
+
+__all__ = [ConnectionError, InvalidStorageVersion, InvalidID,
+ InvalidRevision, InvalidDirectory, NotWriteable, NotReadable,
+ EmptyCommit, STORAGE_VERSIONS, STORAGE_VERSION,
+ get_storage]